Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect minor fixes #13

Merged
merged 5 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading