-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-headwidth.tex
47 lines (37 loc) · 1.24 KB
/
example-headwidth.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
\documentclass[twoside]{article}
\usepackage{lipsum}
\usepackage{boxedminipage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{LEFT HEADER}
\fancyhead[R]{RIGHT HEADER}
\fancyfoot[L]{LEFT FOOTER}
\fancyfoot[R]{RIGHT FOOTER}
\addtolength{\headwidth}{1cm}
\begin{document}
\noindent
\begin{boxedminipage}{\textwidth}
This is a test for various ways to change and use \verb|\headwidth| for both headers and footer.
On the first two pages we enlarge the \verb|\headwidth| with 1~cm.
\begin{verbatim}
\addtolength{\headwidth}{1cm}
\end{verbatim}
As this is a two-sided document, the header and footer will stick out on the right for odd pages and on the left for even pages.
\end{boxedminipage}
\bigskip
\lipsum[1-9]
\newpage
\fancyheadoffset[LR]{1cm}
\noindent
\begin{boxedminipage}{\textwidth}
On the following pages we enlarge the headers with
\begin{verbatim}
\fancyheadoffset[LR]{1cm}
\end{verbatim}
So the header and footer will stick out on both sides for 1~cm on all pages.
As the footer doesn't have offsets defined, its width reverts to the original \verb|\textwidth|.
So the enlarged \verb|\headwidth| from the beginning of the document will not be used once a \verb|\fancy...offset| is given.
\end{boxedminipage}
\bigskip
\lipsum
\end{document}