Looking for a Way to Nullify All Footnotes without Actually Removing Them from the Code

footnoteslistsluatex

I am presently working on a document containing hundreds of Latin footnotes. The document is compiled with lualatex.

I would like to create a parallel document which displays none of the footnotes as a counterpart to the other, which displays them all.

It would be an arduous task to remove them manually, and I can think of no way to efficiently remove them without possibly wreaking havoc.

Consider the following code:

\documentclass[12pt]{book}
\textheight= 2.5in
\begin{document}
\thispagestyle{empty}

This is a sentence.\footnote{First footnote}
This is another sentence.\footnote{Second footnote}
This is another sentence.\footnote{Third footnote}
This is another sentence.\footnote{Fourth footnote}
This is another sentence.\footnote{Fifth footnote}
This is another sentence.\footnote{Sixth footnote}
This is another sentence.\footnote{Seventh footnote.}
\end{document}

which produces the output:

enter image description here

QUESTION: Is it possible to keep all of the the footnote commands as they currently appear in the code, yet nullify (i.e., deactivate) them somehow so that: (i) neither a footnotemark in the output text (ii.) nor a list of footnotes appears? If so, how may this be done?

Thank you.

Best Answer

One can, while leaving the document source code intact, redefine what \footnote[option]{text} performs with

\renewcommand\footnote[2][]{}

In essence, this eliminates the full effect of all footnotes, whether or not they use an optional argument in their invocation.

The only things one need pay additional attention to is whether the document uses \footnotemark and/or \footnotetext explicitly (if so, you will need to redefine these, as well) and to understand that any labels or citations that are created inside of a footnote will be lost to anything trying to \ref them elsewhere.

\documentclass[12pt]{book}
\textheight= 2.5in
\renewcommand\footnote[2][]{}
\begin{document}
\thispagestyle{empty}

This is a sentence.\footnote{First footnote}
This is another sentence.\footnote{Second footnote}
This is another sentence.\footnote{Third footnote}
This is another sentence.\footnote{Fourth footnote}
This is another sentence.\footnote{Fifth footnote}
This is another sentence.\footnote{Sixth footnote}
This is another sentence.\footnote{Seventh footnote.}
\end{document}

enter image description here

Related Question