[texhax] Footnotes in separate file

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Mon Apr 5 00:23:42 CEST 2010


OK, here's a first attempt -- no guarantees, but
it seems to work for my trivial test case !

[Master source]

\let \Footnote = \footnote
\newcount \footnotecount
\def \footnote #1%
     {%
         \unskip
         \global \advance \footnotecount by 1
         \Footnote {$^\the \footnotecount$}{\csname footnote:#1\endcsname}%
     }
\input footnotes

This is some text \footnote {1}; this is some more text
\footnote {3}; this is the final stretch of text \footnote {2}.
\end

[Footnotes.tex]

\newcount \footnotecounter
\def \newfootnote #1%
     {%
         \global \advance \footnotecounter by 1
         \expandafter \def \csname footnote:\the \footnotecounter \endcsname {#1}
     }

\newfootnote {This is the footnote text for footnote 1}
\newfootnote {This is the footnote text for footnote 2}
\newfootnote {This is the footnote text for footnote 3}

** Phil.
--------
Nicholas Cole wrote:
> On Sun, Apr 4, 2010 at 6:02 PM, Philip TAYLOR<P.Taylor at rhul.ac.uk>  wrote:
>> Fine, understood.  Are you using Plain TeX
>> (in which case I may be able to write the macros
>> for you), or LaTeX (in which case I would leave
>> it to others) ?
>>
>> ** Phil.
>
> Dear Phil,
>
> That is a very kind offer indeed.  I'm using LaTeX, but my
> understanding is that TeX macros would work.  And in any case, if you
> could show me how to do it in TeX it might in any case help me grapple
> with a  LaTeX-friendly version.
>
> Best wishes,
>
> N.


More information about the texhax mailing list