I need to compile with this string (this question is related to this other):
latex '\AtBeginDocument{\newcounter{MyFootnote} \let\MyOldFootnote\footnote \renewcommand{\footnote}[1]{\stepcounter{MyFootnote}\label{FootnoteMark\arabic{MyFootnote}}\MyOldFootnote{\label{FootnoteText\arabic{MyFootnote}}#1}}} \input{myfile.tex}'
(I'm sorry but I don't know hot to diplay it in a more readeble way...)
But it would be better if I could use latexmk instead. I tried:
latexmk -latex="\AtBeginDocument{\newcounter{MyFootnote} \let\MyOldFootnote\footnote \renewcommand{\footnote}[1]{\stepcounter{MyFootnote}\label{FootnoteMark\arabic{MyFootnote}}\MyOldFootnote{\label{FootnoteText\arabic{MyFootnote}}#1}}}" myfile.tex
but it doesn't work.
Here's a MWE:
\begin{document}
\setcounter{section}{4}
\section{Section}
Some dummy text.\footnote{Some dummy text.}
\end{document}
myfile.abcwheremyfile.abcis\AtBeginDocument{\newcounter{MyFootnote} \let\MyOldFootnote\footnote \renewcommand{\footnote}[1]{\stepcounter{MyFootnote}\label{FootnoteMark\arabic{MyFootnote}}\MyOldFootnote{\label{FootnoteText\arabic{MyFootnote}}#1}}}\input{myfile.tex}? – David Carlisle Jul 22 '17 at 09:42latexmk myfile.abcas you suggested... but it does not work. – Gabriele Jul 22 '17 at 10:25texdoc latemkfor TeX Live. – Herb Schulz Jul 22 '17 at 22:19