Skip to content

Commit

Permalink
Merge pull request #13 from kulp/collected-fixes
Browse files Browse the repository at this point in the history
Collect minor fixes
  • Loading branch information
kulp authored May 23, 2024
2 parents cc69923 + 27f4934 commit 57ed2d5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions booklayout/ebook.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -66,8 +69,6 @@
}
\end{multicols}

\noindent\rule{0.5\textwidth}{.4pt}

\restoregeometry

\end{document}
Expand Down
16 changes: 12 additions & 4 deletions scripts/make_index.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ($$)
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -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) : ""),
Expand Down
6 changes: 2 additions & 4 deletions scripts/make_metrical_index.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57ed2d5

Please sign in to comment.