Footnote of several paragraphs length to section title

I have a long footnote attached to a section title. It spans three paragraphs. Latex complains ! Paragraph ended before \M@sect was complete.. What's the best way of doing this, if one has to do it at all? Use protect before the footnote and manually break lines via \\, but then I have no indentation of second and third paragraph?

\documentclass{memoir}
\begin{document}
\paragraph{I am a paragraph\footnote{This footnote has more than one paragraph.

This is the second paragraph.

This is the third paragraph}%end footnote
}%end paragraph
\end{document}


Edit:

Trying to follow barbara's suggestion I've done the following, which seems to produce the desired result in my real file, but in the MWE the numbering is off, so I'm worried I'm still missing something here:

\documentclass{memoir}
\begin{document}

\paragraph{I am a paragraph.\protect\footnotemark}
\footnotetext{This footnote has more than one paragraph.

This is the second paragraph.

This is the third paragraph.}
\end{document}

• better to try to handle this with \footnotemark in the \paragraph argument, and \footnotetext{...} separately, outside of the header text. since \paragraph has a "moving argument", the whole thing must be short enough to be copied in one piece into the .aux file, and a footnote with multiple paragraphs certainly isn't! – barbara beeton Jun 4 '15 at 18:44
• You could replace the blank lines by \endgraf but I get an erro rfor any footnote here even \footnote{} why not put it after the heading? – David Carlisle Jun 4 '15 at 18:59
• @barbarabeeton : Please see my edit. – muk.li Jun 5 '15 at 4:38
• @muk.li -- can't figure out why the number on the paragraph isn't being stepped, but there's another way around the problem. answer posted. – barbara beeton Jun 5 '15 at 14:20

the "obvious" approach here is to separate this into \footnotemark and \footnotetext{...}. unfortunately, with the example provided, memoir delivers a footnote number one lower than it should be in the footnote itself. a reasonably detailed examination of the memoir code for \paragraph and footnotes failed to uncover the reason.

but there's another straightforward way to handle this: keep the whole footnote within the \paragraph argument, but don't use blank lines to separate the paragraphs. instead, use \protect\endgraf to indicate the divisions.

here we illustrate both approaches.

\documentclass{memoir}
\setlength{\textheight}{2.25in}
\begin{document}
\thispagestyle{empty}
some text

\paragraph{I am a paragraph.\protect\footnote
{This footnote has more than one paragraph.\protect\endgraf
This is the second paragraph.\protect\endgraf
This is the third paragraph.}}

some text

\paragraph{I am a paragraph.\protect\footnotemark}
\footnotetext{This footnote has more than one paragraph.

This is the second paragraph.

This is the third paragraph.}

some text

\end{document}


Fool TeX into not seeing \par (or a blank line) in the argument to the sectional command.

\documentclass{memoir}

\newcommand{\footnoted}[3]{%
% #1 is the sectional command
% #2 is the title
% #3 is the footnote
\long\def\next{#3}%
#1[#2]{#2\footnote{\next}}%
}

\begin{document}

\footnoted\paragraph{I am a paragraph}
{This footnote has more than one paragraph.

This is the second paragraph.

This is the third paragraph.}

\end{document}

\documentclass{memoir}
\begin{document}
\paragraph[zzz]{I am a paragraph\footnote{This footnote has more than one paragraph.
This is the second paragraph.
%
This is the third paragraph}%end footnote