X-Git-Url: https://git.distorted.org.uk/~mdw/mdwtools/blobdiff_plain/21d3670d0db0796c709a9bca94a80ca4a9848b6f..6baaab46d68d55f3202911b5bf08707bca4ec1b2:/mdwtools.tex?ds=sidebyside

diff --git a/mdwtools.tex b/mdwtools.tex
index c221045..391ae90 100644
--- a/mdwtools.tex
+++ b/mdwtools.tex
@@ -6,19 +6,6 @@
 %
 % (c) 1996 Mark Wooding
 %
-%----- Revision history -----------------------------------------------------
-%
-% $Log: mdwtools.tex,v $
-% Revision 1.2  2003/09/05 16:15:33  mdw
-% Fix title typesetting: use Oxford comma.
-%
-% Revision 1.1  2002/02/03 20:49:03  mdw
-% Checkin for new build system.
-%
-% Revision 1.4  1996/11/19 20:55:55  mdw
-% Entered into RCS
-%
-%
 % \end{meta-comment}
 %
 % \begin{meta-comment} <general public licence>
@@ -49,7 +36,7 @@
 %</mdwtools>
 % \end{meta-comment}
 %
-% \CheckSum{672}
+% \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
@@ -142,7 +129,7 @@
 % everything works.  It will automatically read in the licence text (from
 % |gpl.tex|, and wraps some other things up.
 %
-% 
+%
 % \subsection{Other commands}
 %
 % The |mdwtools.tex| file includes the \package{syntax} and \package{sverb}
@@ -434,8 +421,8 @@
 % names and environment names (both in the sans serif font, for now).
 %
 %    \begin{macrocode}
-\tlet\package\textsf
-\tlet\env\textsf
+\tdef\package{\textsf}
+\tdef\env{\textsf}
 %    \end{macrocode}
 %
 % I'll define the |\<|\dots|>| shortcut for syntax items suggested in the
@@ -965,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@%
@@ -988,21 +978,22 @@
       \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}.%
-      }\space%
+      }%
     }%
 %    \end{macrocode}
 %
@@ -1026,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}
@@ -1087,13 +1078,29 @@
 % following hacking will do this.
 %
 %    \begin{macrocode}
-  \edef\next{\endgroup\noexpand\title{\mdw@title}}%
+  \edef\next{\endgroup\noexpand\title{\noexpand\mdw@titlehack\mdw@title}}%
   \next%
 }
 %    \end{macrocode}
 %
 % \end{macro}
 %
+% \begin{macro}{\mdw@titlehack}
+%
+% Wait!  Did you notice that |\mdw@titlehack|?  What's that about?
+%
+% It turns out that the default document classes hack the footnote insertion
+% commands to make footnote symbols take up no horizontal space in the title.
+% Apparently this makes author names look as if they're centred properly when
+% there are affiliation footnotes.  Anyway, \package{doc} perpetuates this
+% silliness, but it makes a mess of the version markers I insert, so I must
+% deploy countermeasures.
+%
+%    \begin{macrocode}
+\def\mdw@titlehack{\def\@makefnmark{$\m@th^{\@thefnmark}$}}
+%    \end{macrocode}
+%
+% \end{macro}
 %
 % \subsection{Starting the main document}
 %
