[Tex/LaTex] Use input file in \thanks{}

footnotesinputtitles

Is it possible to acheive something similar to

\title{\myTitle \thanks{ \input{../acknowledgement} }}

(which doesn't work?) in order to load the content for \thanks on the fly?

Best Answer

I assume "doesn't work" means in this case "Generates the following error:"

! Use of \@xfootnotemark doesn't match its definition.
\@ifnextchar ... \reserved@d =#1\def \reserved@a {
                                                  #2}\def \reserved@b {#3}\f...
l.8 \maketitle

Right?

\thanks expands its argument (at least which the standard classes) and so you need to \protect the \input:

\documentclass{article}

\def\myTitle{My title}

\title{\myTitle\thanks{\protect\input{../acknowledgement}}}

\begin{document}
\maketitle
text
\end{document}

An alternative would be the catchfile package to store the content of the input file in a macro first using \CatchFileDef{\mymacro}{<file>}{}.

Related Question