I want more than one title for each topic in one document, I don't want to just combine two or three pdfs. And I want to show different headers starting from each title page. There's one problem I cannot solve.
I just used
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{titling}
\pagestyle{fancy}
\setlength{\parindent}{0pt}
\setlength{\parskip}{8pt}
\setlength{\topmargin}{-0.5cm}
\setlength{\droptitle}{-1.5in}
\fancyhead{}
\lhead{Personal Statement}
\rhead{name}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\title{Personal Statement}
\author{name}
\date{Oct 25 2013}
\begin{document}
\maketitle
a lot of contents here
\title{Previous Projects and Future Plans}
\author{}
\date{}
\fancyhead{}
\lhead{Previous Projects and Future Plans}
\rhead{name}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\maketitle
a lot of contents here
\end{document}
The titles can be displayed correctly, but headers cannot. The last page under the first title displayed the second header, I don't know why because my \lhead{}
and \rhead{}
are after the second \title
. Hope someone can help.
I'm also wondering if it's formal to use \tile and \maketitle several times in one document? If not, is there any better way to do so? And could anybody tell me the scope of the typesetting macros at the beginning (\setlength, \lhead and so on)? I'm not sure how to limit their scope if they're meant to be applied to the whole contents of the document. Thanks a lot.
\documentclass{...}
and ending with\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem.\author
; but you can define your own. E.g.,:\newcommand{\theauthor}{} \newcommand{\Author}[1]{\renewcommand{\theauthor}[1]{#1}}
and then 'set' the author each time with\Author{Yongfeng Zhang}
and display it with\theauthor
. The scope of\setlength
is 'global' until re-set.