Nested footnotes disrupts comma delineation of footnotes
The following document prints correctly the nested footnote, with commas in the proper places:
\documentclass{article}
\usepackage[multiple]{footmisc}
\begin{document}
This text has multiple sequential footnotes, with
commas at the proper places\footnote{Here is a footnote}%
\footnote{Here is another footnote.\footnotemark{}}%
\footnotetext{This is the nested footnote.}%
\footnote{Here is the third (non-nested) footnote.}.
\end{document}
Here is the result:
I can understand your desire of automatically include multiple nested footnotes, but the "solution" you adopted doesn't seem to be very useful (it produces an error on first compilation, for example). Multiple nested footnotes are shown here
This text has multiple sequential footnotes, with
commas at the proper places\footnote{Here is a footnote}%
\footnote{Here is another footnote.\footnotemark{} with another\footnotemark{}}%
\addtocounter{footnote}{-1}\footnotetext{This is the first nested footnote.}%
\addtocounter{footnote}{1}\footnotetext{This is the second nested footnote.}%
\footnote{Here is the third (non-nested) footnote.}.
You can probably work from here to get a working solution.
Updated answer, fnpct
version 1.x
You can use fnpct
. The only thing you need to to is “adapt” \footnotetext
so fnpct
knows that it should step over it:
\documentclass{article}
\usepackage[dont-mess-around]{fnpct}
\usepackage[colorlinks]{hyperref}
\AdaptText\footnotetext{o+m}{\IfNoValueTF{#1}{#NOTE{#2}}{#NOTE[#1]{#2}}}
\begin{document}
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\footnote{Here is a footnote}%
\footnote{Here is another footnote\footnotemark.}\footnotetext{This is the
nested footnote.}\footnote{Here is the third (non-nested) footnote.}.%
\end{document}
This also works with the option ranges
(which do not work well with hyperref
obviously:
\documentclass{article}
\usepackage[dont-mess-around]{fnpct}
\AdaptText\footnotetext{o+m}{\IfNoValueTF{#1}{#NOTE{#2}}{#NOTE[#1]{#2}}}
\setfnpct{ranges}
\begin{document}
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\footnote{Here is a footnote}%
\footnote{Here is another footnote\footnotemark.}\footnotetext{This is the
nested footnote.}\footnote{Here is the third (non-nested) footnote.}.%
\end{document}
Original answer, fnpct
version 0.x
I recently answered another question and somehow got carried away... anyway, there now is a new package, fnpct
, which (by accident, really) offers a solution. Or rather two solutions.
- the
\innernote
command - the
\multfootnote
command
The following code shows three working examples and one with a maybe unexpected output:
\documentclass{article}
% the option turns the punctuation switching and kerning adjustments off:
\usepackage[dont-mess-around]{fnpct}
\usepackage[colorlinks]{hyperref}
\begin{document}
% \innernote works well as long as you don't need to nest another level deeper
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\footnote{Here is a footnote}%
\footnote{Here is another footnote\innernote{This is the nested footnote}.}%
\footnote{Here is the third (non-nested) footnote.}.%
% The consecutive placing works well as long as one uses the package option
% `punct-after' (or the option `dont'mess-around' which calls the former
% implicitly) but fails otherwise:
\newpage
\setfnpct{punct-after=false}
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\footnote{Here is a footnote}%
\footnote{Here is another footnote\innernote{This is the nested footnote}.}%
\footnote{Here is the third (non-nested) footnote.}.%
% if it is a single inner footnote then \multfootnote works, too:
% place \footnotemark and use the * argument (= \footnotetext) inside
% \multfootnote. In this case the package option doesn't disturb anything.
\newpage
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\multfootnote{Here is a footnote;Here
is another footnote\footnotemark.;*This is the nested footnote.;Here is the third
(non-nested) footnote.}.%
% the combination of both methods is probably best:
\newpage
This text has multiple sequential footnotes, but comma delination is disrupted
if one of the footnotes has a nested footnote\multfootnote{Here is a footnote;Here
is another footnote\innernote{This is the nested footnote}.;Here is the third
(non-nested) footnote.}.%
% so we can see that `hyperref' cooperates well:
\newpage\null
\end{document}
The fourth example looks like this: