13

I have one document that combines many documents: Pathoanatomy and Pathophysiology, for instance. I want to start a new document from the body like

\documentclass{article}
\begin{document}
\title{Introduction to Pathoanatomy Notes}
\begin{titlepage}
\maketitle
\end{titlepage}

% first document
 ...
% second document in the some body
\title{Introduction to Pathophysiology Notes}
\begin{titlepage}
\maketitle
\end{titlepage}
...
\end{document}

The output is the right but the style does not remain.

How can you do the same but maintain the style of the title page to the second title?

3 Answers 3

10

No need for any \renewcommands, the titling package already provides this functionality:

\documentclass{article}
\usepackage{titling}
\title{Some Title}
\author{Uwe Ziegenhagen}
\date{01.01.1901}
\usepackage{blindtext}

\begin{document}

\maketitle

\blindtext[5]

\title{Second item}


\maketitle

\blindtext[5]


\end{document}

enter image description here

2
  • 2
    If there's a \thanks in \author, the previous footnotes are printed again in the following \maketitles.
    – Jander
    Aug 5, 2020 at 15:01
  • 2
    Is it possible to delete the second \thanks in the second \maketitle? Jul 9, 2021 at 9:00
5

One option would be to prevent \maketitle from \@emptying \@author, \@title, \@date, etc. Here's the code:

\documentclass{article}

\makeatletter
\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
    }
  \if@titlepage
  \renewcommand\maketitle{\begin{titlepage}%
  \let\footnotesize\small
  \let\footnoterule\relax
  \let \footnote \thanks
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
      \vskip 1.5em%
    {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
  \@thanks
  \vfil\null
  \end{titlepage}%
  \setcounter{footnote}{0}%
}
\else
\renewcommand\maketitle{\par
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hb@[email protected]{%
                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
}
\makeatother

\begin{document}
\title{Introduction to Pathoanatomy Notes}
\author{The Author A}
\begin{titlepage}
\maketitle
\end{titlepage}

\title{Another Title}
\author{The Author B}
\begin{titlepage}
\maketitle
\end{titlepage}

\end{document}

enter image description here

1
1

You could do this with the titling package. This answer shows how to use the commands from that package to put the titles into the header using fancyhdr and how to extend the package to support subtitles.

\documentclass{article}
\usepackage{titling}

\usepackage{fancyhdr}% just for fun - if you are using a class which doesn't like this, just leave it out
  \fancyhf{}
  \fancyhf[ch]{\scshape \thetitle}
  \fancyhf[cf]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \pagestyle{fancy}

% if you would like a subtitle as well
\makeatletter
   \newcommand{\my@presubtitle}{}
    \newcommand{\my@postsubtitle}{}
    \newcommand{\thesubtitle}{}
    \let\thesubtitle\@empty
    \newcommand{\presubtitle}[1]{%
            \renewcommand{\my@presubtitle}{#1}}
    \newcommand{\postsubtitle}[1]{%
            \renewcommand{\my@postsubtitle}{#1}}
    \newcommand{\subtitle}[1]{%
            \renewcommand\thesubtitle{#1}%
            \renewcommand{\maketitlehookb}{%
                    \par\noindent \my@presubtitle\thesubtitle\my@postsubtitle}}
    \presubtitle{\begin{center}\Large}
    \postsubtitle{\par\end{center}}
    \renewcommand{\maketitlehookb}{\presubtitle \subtitle \postsubtitle}
\makeatother

\usepackage{kantlipsum}% just for sample text - don't use for real!

\begin{document}
\title{Introduction to Pathoanatomy Notes}
\subtitle{A Guide for the Perplexed}
\begin{titlingpage}% Note that this environment differs from titlepage - see package documentation for details
\maketitle
\end{titlingpage}
% first document
\kant[1-5]\clearpage

% second document in the some body
\title{Introduction to Pathophysiology Notes}
\subtitle{Anatomy for the Adventurous}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\kant[6-10]

\end{document}

Multiple title pages with subtitles

You must log in to answer this question.

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