Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a report with two parts using the article class.

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}

\usepackage[english]{babel}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}   
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}

\title{\huge Title1 \\}
\author{\normalfont                 \normalsize
    Author\\                        \normalsize
    Supervisors: Prof. X}
\date{}

\begin{document}

\part{Heisenberg Picture}

\maketitle

\section{Section 1}


\clearpage

\part{Schroedinger Picture}

%\maketitle2

\section{Section 1}

\end{document}

I need two parts titled say, \part{Heisenberg Picture} and \part{Schroedinger Picture}. These parts correspond to Title 1,Supervisor X and Title 2,Supervisor Y respectively. How can I redefine the \maketitle command to do this? (If it's too complicated, is there an easier method?)

share|improve this question
    
Related (almost duplicate) question: Using \maketitle twice in the same article. The same solution will work for your case. I'll post an answer though because your question is slightly different. –  Alan Munn Jul 23 at 3:37

2 Answers 2

up vote 2 down vote accepted

The titling package does exactly what you require. I've also cleaned up your code to put the formatting parts into the \pretitle etc. commands leaving the contents of \title and author free of formatting.

\documentclass[a4paper,11pt]{article}
\usepackage{titling}
\pretitle{\begin{center}\huge}
\posttitle{\par\end{center}\vspace{\baselineskip}}
\preauthor{\normalfont\normalsize\begin{center}\begin{tabular}[t]{c}}
\postauthor{\end{tabular}\end{center}\vspace{\baselineskip}}

\title{Title 1}
\author{Author\\Supervisors: Prof. X}
\date{}

\begin{document}

\part{Heisenberg Picture}

\maketitle

\section{Section 1}

\clearpage

\part{Schroedinger Picture}
\title{Title 2}
\author{Author\\Supervisors: Prof Y}
\maketitle

\section{Section 1}

\end{document}
share|improve this answer
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}

\usepackage[english]{babel}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}   
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\usepackage{sectsty}
\allsectionsfont{\centering \normalfont\scshape}
\usepackage{fancyhdr}

%%%Solution package%%%
\usepackage{titling}
%%%%%%%%%%%%%%%%%%%%%%

\title{\huge Title1 \\}
\author{\normalfont                 \normalsize
    Author\\                        \normalsize
    Supervisors: Prof. X}
\date{}

\begin{document}

\part{Heisenberg Picture}

\maketitle

\section{Section 1}

\clearpage

\part{Schroedinger Picture}

%still usable due to `titling`
\title{\huge Title2 \\}
\author{\normalfont                 \normalsize
    Author\\                        \normalsize
    Supervisors: Prof. Y}
\date{}

\maketitle%2

\section{Section 1}

\end{document}
share|improve this answer
    
This is the same as my answer, but preserving the non-ideal practice of putting formatting into the title/author commands themselves. –  Alan Munn Jul 23 at 4:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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