I want to implement the nested footnotes appearing in a single sequence as in Nested footnotes with the memoir class. While the solution given by Werner as an answer to that question does work at first glance, but because it is based on the definitions in the article class it eliminates the multiple footnote feature in memoir (similar to \usepackage[multiple]{footmisc}
). The mwe below shows the problem. The correct formatting of the footnote marks can be seen by commenting out the redefinitions of \footnotemark
and \footnotetext
.
\documentclass{memoir}
\usepackage{letltxmacro}
\newcounter{fnmarkcntr}
\newcounter{fntextcntr}
\makeatletter
\renewcommand{\footnotemark}{%
\@ifnextchar[\@xfootnotemark
{\stepcounter{fnmarkcntr}%
\refstepcounter{footnote}\label{footnotemark\thefnmarkcntr}%
\protected@xdef\@thefnmark{\thefootnote}%
\@footnotemark}}
\makeatother
\LetLtxMacro{\oldfootnotetext}{\footnotetext}
\renewcommand{\footnotetext}[1]{%
\refstepcounter{fntextcntr}
\oldfootnotetext[\ref{footnotemark\thefntextcntr}]{#1}
}
\begin{document}
This text has footnotes%
\footnote{Which contains sub-footnotes\footnotemark% \multfootsep
\footnotemark that should be marked clearly as separate}%
\footnotetext{This footnote should be labeled `2'}%
\footnotetext{This footnote should be labeled `3'}%
\footnote{Another footnote}%
\end{document}
The output has badly formatted footnote marks, both in the main text and in the first footnote:
Without the two \renewcommand
s we get the default output which numbers the footnotes wrong:
I think \m@makefootnotemark
(and maybe other macros) from memoir needs to be modified but its definition (and usage) is too complicated for me to figure out the necessary change by analogy.
\documentclass
frommemoir
toarticle
. The result looked bad to me. Are you sure about what you want to happen? But perhaps I am completely confused.memoir
toarticle
. But removing/commenting out the two\renewcommands
shows what I want it to look like (except for the incorrect numbering).memoir
toarticle
both produce output that's like the first screenshot (ignoring the difference in margins and page number placement), whereas I want the appearance to be more like the second screenshot except for the incorrect numbering.\renew...
commands there was no difference betweenmemoir
andarticle
output. Without the\renew...
commands thememoir
output put a comma between between multiple footnote markers (like1,4
or2,3
) but thearticle
output just strung multiple footnote markers together (like14
or23
). Good luck.