[Tex/LaTex] \footnotetext numbering for many \footnotemark – automatic solution

footnotesnumbering

\documentclass{report}
\begin{document}
Text\footnote{text1} Text\footnote{text2}

\vbox{%
\begin{itemize}
\item X\footnotemark{}
\item Y\footnotemark{}
\item Z\footnotemark{}
\end{itemize}
}
\footnotetext{a}
\footnotetext{b}
\footnotetext{c}
\end{document}

generates:

Text^1 Text^2

* X^3
* Y^4
* Z^5

-------------
1 text1
2 text2
5 a
5 b
5 c

How to recover \footnotetext numbering without manual numbering?

I assume, I know that I used \footnotemark n times, so I would like solution like (It is "pseudocode" of draft of an idea) :

\newcounter{tempcounter := footnotecounter - n}
\footnotetext[ ++tempcounter ]{a}
\footnotetext[ ++tempcounter ]{b}
\footnotetext[ ++tempcounter ]{c}

Or other authomatic numbering solution. I don't want to manually correct this list each time I change footnotes in chapter.

P.S. I know putting list into vbox might look strange, please assume it's just a toy-example of environment that needs usage of \footnotemark+\footnotetext.

Best Answer

\documentclass{report}

\begin{document}

Text\footnote{text1} Text\footnote{text2}

\begin{itemize} 
 \item X\footnotemark{} \item Y\footnotemark{} \item Z\footnotemark{} 
\end{itemize}

 \addtocounter{footnote}{-3} %3=n
 \stepcounter{footnote}\footnotetext{a}
 \stepcounter{footnote}\footnotetext{b}
 \stepcounter{footnote}\footnotetext{c}
\end{document}

enter image description here