3

I need to have two \maketitles in a document. The titling package handles this almost perfectly. The issue is that I use the \thanks command in the \title and in the \author, and then, in the second \maketitle, the text of the \thanks command is repeated twice. Does anyone know how I can get rid of the second occurrence of the text of the \thanks command? Thanks, Eilon

\documentclass[12pt]{article}
\usepackage{titling}
\begin{document}

\begin{titlepage}
\title{First title\thanks{I thank my kids.}}
\author{Author1\thanks{Affiliation of author1. } and Author2\thanks{Affiliation of author2.}}
\maketitle
\end{titlepage}

\begin{titlepage}
\title{Second title}
\maketitle
\end{titlepage}
\end{document}

2 Answers 2

2

LaTeX collects all footnotes added by \thanks commands in a macro \@thanks; it has to be emptied before typesetting the second title. To avoid that the second title page resets the page counter, we use the xpatch package and modify the titlepage environment; this is a hack, though. Alternatively, you can set the page number manually using \setcounter{page}{... desired page number ...}.

\documentclass[12pt]{article}
\usepackage{titling}
\usepackage{xpatch}
\makeatletter
\newenvironment{mytitlepage}%
  {\begin{titlepage}\def\@thanks{}}%
  {\end{titlepage}}
\xpatchcmd\titlepage{\setcounter{page}\@ne}{}{}{}
\xpatchcmd\endtitlepage{\setcounter{page}\@ne}{}{}{}
\makeatother
\begin{document}

\begin{mytitlepage}
\title{First title\thanks{I thank my kids.}}
\author{Author1\thanks{Affiliation of author1.}
    and Author2\thanks{Affiliation of author2.}}
\maketitle
\end{mytitlepage}

\begin{mytitlepage}
\title{Second title}
\maketitle
\end{mytitlepage}
\end{document}
2
  • In fact, there is a slight problem with the solution: it creates TWO pages that are numbered 1 (the first page and the second page). This happens twice, once for each title. (To see the problem, add text after each title). Any solution?
    – Eilon
    Commented Oct 23, 2016 at 14:07
  • @Eilon I have modified my solution to handle the page number issue.
    – gernot
    Commented Oct 23, 2016 at 14:44
0

You could also use the \emptythanks command provided by the titling package.

When I used \emptythanks on its own, the \thanks in the second title used a different footnote marker than the \thanks in the first title. This seems to be because \thanks's internal counter increments even when \emptythanks is used. Here is the code I used to reset the counter so the same footnote marker was used for both titles:

\documentclass{article}
\usepackage{titling}

\title{Title}
\author{Author\thanks{Thank you.}}

\begin{document}
    \maketitle
    
    Some text.\footnote{First footnote.}
    
    % Avoid printing two `\thanks`s
    \emptythanks
    % Create a place to save the current number of in-text footnotes
    \newcounter{footnotecounter}
    % Save the current number of in-text footnotes
    \setcounter{footnotecounter}{\value{footnote}}
    % Reset the footnote counter
    \setcounter{footnote}{0}
    
    \maketitle
    
    % After the title, continue numbering footnotes at the current 
    % number of in-text footnotes
    \setcounter{footnote}{\value{footnotecounter}}

    Some more text.\footnote{Second footnote.}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .