-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitchstyle1.tex
39 lines (28 loc) · 1.02 KB
/
switchstyle1.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
\documentclass[oneside]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{blindtext}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\leftmark}
\fancyhead[R]{\rightmark}
\fancyfoot[C]{\thepage}
\fancypagestyle{special}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{Special Page Style \nouppercase\leftmark}
\fancyfoot[R]{\thepage}
}
\begin{document}
\chapter{Introduction}
This example shows the effects of having the header and footer definitions \emph{global}, i.e. not embedded in the page style. The page style \texttt{special} does have some relevant definitions inside it, but the page style \texttt{fancy} doesn't. So when we change the page style to \texttt{special}, the header and footer definitions are overwritten, and when we switch back to page style \texttt{fancy} they are not reset, as \texttt{fancy} doesn't have them embedded.
\bigskip
\lipsum
\chapter{Special Chapter}
\pagestyle{special}
\lipsum
\chapter{Another Chapter}
\pagestyle{fancy}
\lipsum
\end{document}