mdwtools.tex: Set footnote markers to the right of punctuation in the title.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 5 Sep 2020 14:42:08 +0000 (15:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 7 Sep 2020 15:46:47 +0000 (16:46 +0100)
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.

mdwtools.tex

index e192d13..391ae90 100644 (file)
@@ -36,7 +36,7 @@
 %</mdwtools>
 % \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
 %
 % 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@%
       \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}.%
   \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}