2

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}
1

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}
  • 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 Oct 23 '16 at 14:07
  • @Eilon I have modified my solution to handle the page number issue. – gernot says Reinstate Monica Oct 23 '16 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.