-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitchstyle3.tex
58 lines (45 loc) · 1.37 KB
/
switchstyle3.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
\documentclass[oneside]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{blindtext}
\fancypagestyle*{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}
}
\pagestyle{fancy}
\begin{document}
\chapter{Introduction}
This example shows the effects of having the header and footer definitions embedded in a \emph{closed} page style. The page style \texttt{special} does have some relevant definitions inside it, and the page style \texttt{fancy} too. All the relevant elements that are not explicitely specified, for example, the \verb|headrulewidth| in \texttt{fancy} are picked up from the environment at definition time, which in this example has the defaults.
\begin{verbatim}
\fancypagestyle*{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}
}
\pagestyle{fancy}
\end{verbatim}
\bigskip
\lipsum[1-5]
\chapter{Special Chapter}
\pagestyle{special}
\lipsum
\chapter{Another Chapter}
\pagestyle{fancy}
\lipsum
\end{document}