# Memoir: How to make \newfootnoteseries with multiple paragraphs?

I have two levels of footnotes, one for regular footnotes and one for special editor's footnotes. I would like to put a longer text in an editor's footnote with two paragraphs, however this does not work.

MWE:

\documentclass{memoir}

\usepackage{xcolor}

\newfootnoteseries{E}
\renewcommand\thefootnoteE{\textcolor{red}{\Roman{footnoteE}}}
\let\editornote=\footnoteE

\begin{document}

Text%
\footnote{Footnote paragrah 1.
% -- removing this is fine
Footnote paragraph 2.}%
\editornote{Editor paragraph 1.
% -- removing this breaks
Editor paragraph 2.}

\end{document}

I get the following error when removing the second %:

Runaway argument?
{\rule \z@ \footnotesep \ignorespaces {\@nameuse {foottextfontE}Edito\ETC.
./editornotes.tex:17: Paragraph ended before \@makefntextE was complete.
\par
l.17 Editor paragraph 2.}

?

Strangely, multiple paragraphs work fine in the regular footnote.

• If I understand "long" commands correctly, it seems that the \footnoteE that \newfootnoteseries{E} creates is "starred" --- can I override that? – meide May 17 '19 at 13:37

\documentclass{memoir}

\usepackage{xcolor}

% \newfootnoteseries{E}
% \renewcommand\thefootnoteE{\textcolor{red}{\Roman{footnoteE}}}
% \let\editornote=\footnoteE

\newcounter{editorfn}

\makeatletter
\def\editornote{%
\refstepcounter{editorfn}
\xdef\@thefnmark{\roman{editorfn}} \@footnotetext
}
\makeatother

\begin{document}

Text%
\footnote{Footnote paragrah 1.\\
% -- removing this is fine
Footnote paragraph 2.}%
\editornote{Editor paragraph 1.\\
% -- removing this breaks
Editor paragraph 2.}

\end{document}
• This doesn't show the footnotemark for the editornote anywhere that I can see – meide May 19 '19 at 8:40
• In that case, I suggest you to change the line \xdef\@thefnmark{\roman{editorfn}} \@footnotetext by \xdef\@thefnmark{\roman{editorfn}}$^\mathrm{\@thefnmark}$ \@footnotetext If you prefer subscript instead of superscript, change the ^ by _ – Brasil May 20 '19 at 12:45

It appears that the \newfootnoteseries{E} creates a "short" \@makefntextE which is the cause of the problem. I have tested with a modified memoir.cls locally and it seems to work, but I am unsure what the process is now. Is there a repo to submit patches to?

I also cannot guarantee that it won't mess with other parts of memoir, as I am unfamiliar with its internal workings.

Below, a patch for version v3.7h (2018/12/12)

\$ diff -p /usr/local/texlive/2019/texmf-dist/tex/latex/memoir/memoir.cls memoir.cls
*** /usr/local/texlive/2019/texmf-dist/tex/latex/memoir/memoir.cls  Wed Dec 12 22:24:10 2018
--- memoir.cls  Fri May 17 15:41:06 2019
***************
*** 9362,9368 ****
\m@makefootfootmark{#1}%                       -> \footfootmark#1
\m@makemakefootmark{#1}%                       -> \makefootmark#1
\m@makefootmarkstyle{#1}%                      -> \footmarkstyle#1
!   \@namedef{@makefntext#1}##1{\@nameuse{makefootmark#1} ##1}%
\m@make@footstart{#1}%                         -> \@footstart#1
\m@make@footgroup{#1}%                         -> \@footgroup#1
\expandafter\newinsert\csname @mpfootins#1\endcsname% -> \@mpfootins#1
--- 9362,9368 ----
\m@makefootfootmark{#1}%                       -> \footfootmark#1
\m@makemakefootmark{#1}%                       -> \makefootmark#1
\m@makefootmarkstyle{#1}%                      -> \footmarkstyle#1
!   \@namelongdef{@makefntext#1}##1{\@nameuse{makefootmark#1} ##1}%
\m@make@footstart{#1}%                         -> \@footstart#1
\m@make@footgroup{#1}%                         -> \@footgroup#1
\expandafter\newinsert\csname @mpfootins#1\endcsname% -> \@mpfootins#1

I will hold off on accepting my own answer for a couple weeks, to see if a better one comes along.

• Ok, thanks! Let me know if you need anything from my end :) – meide May 20 '19 at 11:57
• It is now fixed in my development version. It is the fix you provided. BTW I'd never go in and fix the class directly by hand in a situation like this, I'd just copy the problematic construction into your preamble and fix it where before you use it. Currently no idea when I'm going to release the next memoir version – daleif May 24 '19 at 10:24