Created
December 28, 2017 14:26
-
-
Save lydell/d3ac472684c000d3735f30f910169943 to your computer and use it in GitHub Desktop.
LaTeX pagestyle confusion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[twoside]{article} | |
\usepackage{fancyhdr} | |
\usepackage{extramarks} | |
\setlength{\headheight}{14pt} | |
\fancypagestyle{ttlpage}{ | |
\fancyhf{} | |
\fancyhead[L]{First page head} | |
} | |
\fancypagestyle{simple}{ | |
\fancyhf{} | |
\fancyhead[LE, RO]{\thepage} | |
} | |
\fancypagestyle{main}{ | |
\fancyhf{} | |
\fancyhead[LE, RO]{\thepage} | |
\fancyhead[LO]{\firstleftmark} | |
\fancyhead[RE]{\lastrightmark} | |
} | |
\begin{document} | |
\thispagestyle{ttlpage} % Causes problems. | |
%\pagestyle{ttlpage} % Works fine. | |
first page | |
\newpage | |
\pagestyle{empty} % With \thispagestyle above, causes missing \firstleftmark and \lastrightmark | |
%\pagestyle{simple} % With \thispagestyle above, causes "CONTENTS" to be printed instead of "INTRODUCTION", | |
\tableofcontents | |
\newpage | |
\pagestyle{main} | |
\section{Introduction} | |
\subsection{Foo} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment