1

I wish to reproduce the following using the enotez package:

\documentclass{article}
\usepackage{endnotes}

\begin{document}

My text\footnote{my footnote}

\newpage

\theendnotes

\end{document}

The above gives me footnotes and endnotes.

My attempt :

\documentclass{article}
\usepackage{enotez}

\begin{document}

My text\footnote{my footnote}

\newpage

\printendnotes

\end{document}

This is giving my only footnotes.

\documentclass{article}
\usepackage{enotez}
\let\footnote=\endnote

\begin{document}

My text\footnote{my footnote}

\newpage

\printendnotes

\end{document}

This is giving my only endnotes.

How do I get both footnotes and endnotes from enotez package ?

4
  • The first example prints just a footnote and no endnotes.
    – egreg
    Dec 29, 2021 at 11:09
  • I was reading this : web.archive.org/web/20120516064001/http://… The \listofendnotes should replace \theendnotes I think you are right, I am a little confused now. Dec 29, 2021 at 11:27
  • I wish to get footnotes and endnotes from each \footnote incantation in the text using enotez package. Can someone show me how to do that? Dec 29, 2021 at 12:16
  • So you want that \footnote both does \footnote and \endnote with the same text?
    – egreg
    Dec 29, 2021 at 16:17

2 Answers 2

2

You can define \footnote to issue both \footnote and \endnote; this of course requires to use an alias of the original \footnote command.

\documentclass{article}

\usepackage[papersize={52mm,74mm}]{geometry} % just to make a smaller picture

\usepackage{enotez}

\NewCommandCopy{\enotezfootnote}{\footnote}
\RenewDocumentCommand{\footnote}{om}{%
 \IfNoValueTF{#1}
   {\enotezfootnote{#2}\endnote{#2}}
   {\enotezfootnote[#1]{#2}\endnote[#1]{#2}}%
}
\makeatletter
\setenotez{mark-cs=\@gobble}
\makeatother

\begin{document}

My text\footnote{my footnote}

My text\footnote{my second footnote}

\clearpage
\printendnotes

\end{document}

enter image description here

0

Here is how we can do this in Latex-2. The \footnote takes two arguments. I have used only the mandatory argument in redefining it. Can you please show me how I would check for the optional first argument like you do in your answer @egreg in this case ?

\documentclass{article}

\usepackage{enotez}

\let\oldfootnote\footnote
\renewcommand{\footnote}[1]{
  \oldfootnote{#1}\endnote{#1}
}

% Without this we get ***two*** marks, one from the footnote
% and one from the endnote. This disables the endnote mark.

\makeatletter
\setenotez{mark-cs=\@gobble}
\makeatother


\begin{document}

My text\footnote{my footnote}
My text\footnote{my second footnote}

\clearpage
\printendnotes

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .