The `strayman' document class, in particular, sets a running header with
the document title by default. But if the title contains footnote
markers then these end up in every (other) page header, with steadily
incrementing numbers, which is rather bad.
The hack here only supports `strayman'. Most classes don't have
`strayman''s optional running-header argument for `\title', so I can't
use that.
%</mdwtools>
% \end{meta-comment}
%
%</mdwtools>
% \end{meta-comment}
%
%% \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
%% \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
% The first job is to add the previous item to the title string. If this
% is the first item, though, I'll just add the appropriate \lit{The } or
% \lit{ and the } string to the title (this is stored in the |\@prefix|
% The first job is to add the previous item to the title string. If this
% is the first item, though, I'll just add the appropriate \lit{The } or
% \lit{ and the } string to the title (this is stored in the |\@prefix|
+% macro). Also maintain a parallel version which doesn't have the footnotes
+% in: this will be suitable for a running header.
%
% \begin{macrocode}
\edef\mdw@title{%
%
% \begin{macrocode}
\edef\mdw@title{%
\else,\@prevnote\ \@nextitem%
\fi%
}%
\else,\@prevnote\ \@nextitem%
\fi%
}%
+ \edef\mdw@runningtitle{%
+ \mdw@runningtitle%
+ \ifcase\count@\@prefix%
+ \or\@nextitem%
+ \else, \@nextitem%
+ \fi%
+ }%
% \end{macrocode}
%
% That was rather easy. Now I'll set up the |\@previtem| and |\@nextitem|
% \end{macrocode}
%
% That was rather easy. Now I'll set up the |\@previtem| and |\@nextitem|
\else,\@prevnote\ and \@nextitem\@nextnote\space#4%
\fi%
}%
\else,\@prevnote\ and \@nextitem\@nextnote\space#4%
\fi%
}%
+ \edef\mdw@runningtitle{%
+ \mdw@runningtitle%
+ \ifcase\count@%
+ \or\@nextitem\space#3%
+ \or\ and \@nextitem\space#4%
+ \else,\ and \@nextitem\space#4%
+ \fi%
+ }%
% \end{macrocode}
%
% Finally, if $|\count@| \ne 0$, I must set |\@prefix| to \lit{ and the }.
% \end{macrocode}
%
% Finally, if $|\count@| \ne 0$, I must set |\@prefix| to \lit{ and the }.
%
% \begin{macrocode}
\def\mdw@title{}%
%
% \begin{macrocode}
\def\mdw@title{}%
+ \def\mdw@runningtitle{}%
\def\@prefix{The }%
% \end{macrocode}
%
\def\@prefix{The }%
% \end{macrocode}
%
% following hacking will do this.
%
% \begin{macrocode}
% following hacking will do this.
%
% \begin{macrocode}
- \edef\next{\endgroup\noexpand\title{\noexpand\mdw@titlehack\mdw@title}}%
+ \edef\next{%
+ \endgroup%
+ \noexpand\title{\noexpand\mdw@titlehack\mdw@title}%
+ \def\noexpand\@headertitle{\mdw@runningtitle}%
+ }%
\next%
}
% \end{macrocode}
\next%
}
% \end{macrocode}