From: Mark Wooding Date: Sat, 5 Sep 2020 14:42:08 +0000 (+0100) Subject: mdwtools.tex: Set footnote markers to the right of punctuation in the title. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mdwtools/commitdiff_plain/6baaab46d68d55f3202911b5bf08707bca4ec1b2 mdwtools.tex: Set footnote markers to the right of punctuation in the title. I decided a long time ago that setting footnote markers to the left of punctuation looks rather bad. Apparently, this code is even older than that, so it needs fixing. Unfortunately, we don't know the punctuation in advance, so we need to delay setting the footnotes by yet another loop iteration. Ugh. --- diff --git a/mdwtools.tex b/mdwtools.tex index e192d13..391ae90 100644 --- a/mdwtools.tex +++ b/mdwtools.tex @@ -36,7 +36,7 @@ % % \end{meta-comment} % -% \CheckSum{679} +% \CheckSum{691} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -952,7 +952,10 @@ % % Now to get to work. I need to keep one `lookahead' list item, and a count % of the number of items read so far. I'll keep the lookahead item in -% |\@nextitem| and the counter in |\count@|. +% |\@nextitem| and the counter in |\count@|. Things are even worse because +% the footnote symbols should appear \emph{after} the separating punctuation, +% so we need to delay those by another cycle, hence we have |\@nextnote| and +% |\@prevnote|. % % \begin{macrocode} \count@\z@% @@ -975,17 +978,18 @@ \mdw@title% \ifcase\count@\@prefix% \or\@nextitem% - \else, \@nextitem% + \else,\@prevnote\ \@nextitem% \fi% }% % \end{macrocode} % -% That was rather easy. Now I'll set up the |\@nextitem| macro for the -% next time around the loop. +% That was rather easy. Now I'll set up the |\@previtem| and |\@nextitem| +% macros for the next time around the loop. % % \begin{macrocode} - \edef\@nextitem{% - \protect#2{##1}% + \edef\@nextitem{\protect#2{##1}}% + \let\@prevnote\@nextnote + \edef\@nextnote{% \protect\footnote{% The \protect#2{##1} #3 is currently at version % \mdwfileinfo{##1}{version}, dated \mdwfileinfo{##1}{date}.% @@ -1013,9 +1017,9 @@ \edef\mdw@title{% \mdw@title% \ifcase\count@% - \or\@nextitem\space#3% - \or\ and \@nextitem\space#4% - \else,\ and \@nextitem\space#4% + \or\@nextitem\@nextnote\space#3% + \or\@prevnote\ and \@nextitem\@nextnote\space#4% + \else,\@prevnote\ and \@nextitem\@nextnote\space#4% \fi% }% % \end{macrocode}