-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample7.tex
53 lines (42 loc) · 1.34 KB
/
example7.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
\documentclass{book}
\usepackage{lipsum}
\usepackage{makeidx}
\usepackage{boxedminipage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{\nouppercase{\rightmark}}
\fancyhead[LO,RE]{\nouppercase{\leftmark}}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\makeindex
\begin{document}
\chapter{Introduction}
\index{lipsum}
\begin{boxedminipage}{\textwidth}
This is example 7 in the fancyhdr documentation.
This demonstrates the use of \verb|\chaptermark| and \verb|\sectionmark|. In contrast to the standard \LaTeX{} definitions, we don't use \verb|\MakeUppercase|.
\begin{verbatim}
\fancyhead[LE,RO]{\nouppercase{\rightmark}}
\fancyhead[LO,RE]{\nouppercase{\leftmark}}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\end{verbatim}
On the Index page the header should be ``Index'' without uppercase because we use \verb|\nouppercase| in the headers.
\end{boxedminipage}
\section{The Problem}
\label{sec:problem}
\lipsum[1]
\section{Evaluation}
\lipsum[2]
\chapter{Implementation}
Introduction of this chapter
\lipsum[3]
\section{First steps}
\label{sec:first-steps}
\lipsum
\printindex
\newpage
``Index'' should be in header without all uppercase.
\end{document}