diff --git a/Makefile b/Makefile index 4089ef39..8b529211 100644 --- a/Makefile +++ b/Makefile @@ -221,7 +221,7 @@ booklayout/index.meter: $(LYS:%.ly=PDF/eogsized/%.meter) .PHONY: FORCE booklayout/revision.tex: FORCE - git describe --always --match='v*' > $@ + git describe --long --always --match='v*' > $@ booklayout/toplevel.pdf: booklayout/revision.tex booklayout/book.tex booklayout/toplevel.pdf: $(foreach f,metrical first gospel children,booklayout/$f_insert.tex) diff --git a/booklayout/ebook.tex b/booklayout/ebook.tex index 5193a159..39d4a489 100644 --- a/booklayout/ebook.tex +++ b/booklayout/ebook.tex @@ -25,6 +25,9 @@ \begin{document} \pagenumbering{gobble} +% See https://tex.stackexchange.com/a/587488 for '\lllap': +\newcommand{\lllap}[1]{\makebox[0pt][r]{#1}} + \input{booklayout/ebook_index} \input{booklayout/letterbook} @@ -66,8 +69,6 @@ } \end{multicols} -\noindent\rule{0.5\textwidth}{.4pt} - \restoregeometry \end{document} diff --git a/scripts/make_index.pl b/scripts/make_index.pl index 667b5209..82cf9e2f 100755 --- a/scripts/make_index.pl +++ b/scripts/make_index.pl @@ -4,6 +4,7 @@ use CGI qw(:standard); # just for HTML shortcuts use File::Basename qw(basename dirname); +use HTML::Entities qw(encode_entities); use List::MoreUtils qw(uniq); sub get_key ($$) @@ -32,6 +33,13 @@ ($$) my $basic = 379; my $total = $basic + 8; +sub safe ($) +{ + # We specifically name the characters we want to avoid, in order to avoid + # mojibake from encoding multibyte UTF-8 sequences as individual entities: + return encode_entities($_[0], q(<>&"')); +} + print start_html(-title => "Echoes of Grace layout project", -style => { -src => "scripts/main.css" }, @@ -94,10 +102,10 @@ ($$) Tr( th({ -class => "index", customkey => $order } , "$addl$int"), - td({ -class => "title", customkey => $safetitle } , $title), - td({ -class => "poet" } , $poet), - td({ -class => "composer" } , $composer), - td({ -class => "tunename" } , $tunename), + td({ -class => "title", customkey => $safetitle } , safe($title)), + td({ -class => "poet" } , safe($poet)), + td({ -class => "composer" } , safe($composer)), + td({ -class => "tunename" } , safe($tunename)), (map { my $dir = $_; map { my $where = "$dir/$_/$stem.$exts{$dir}"; td({ -class => "link" }, (-e $where) ? a({ -href => $where }, $dir) : ""), diff --git a/scripts/make_metrical_index.pl b/scripts/make_metrical_index.pl index 2c2f32b2..11447fb4 100755 --- a/scripts/make_metrical_index.pl +++ b/scripts/make_metrical_index.pl @@ -44,10 +44,8 @@ sub munge { # Schola (lualatex with that font works; tectonic with the default font works). sub fix_chars { local $_ = shift; - s/^“/\\lllap{``}/; - s/“/``/g; - s/”/''/g; - s/‘/`/g; + die "No support for quotation marks here" if /[“”‘]/; + # Apostrophes are supported: s/’/'/g; s/–/\\textendash{}/g; s/—/\\textemdash{}/g;