-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththreeboxes.tex
39 lines (30 loc) · 1.1 KB
/
threeboxes.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{article}
\usepackage[headheight=40pt, includehead]{geometry} % for margins on a A4paper
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{kantlipsum}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\sffamily
\fancyhdrbox{\includegraphics[height=3\normalbaselineskip]{example-image}}}
\fancyhead[R]{%
\fancyhdrbox[][4cm]{Our Office \\ Street 1 \\ City1 }%
\fancyhdrbox[l]{ Our Factory \\ Street 2 \\ City2 }
}
\setlength{\parindent}{0pt}
\setlength{\parskip}{4pt}
\begin{document}
This example shows the use of \verb|\fancyhdrbox| in the header. The left header has an image in a \verb|\fancyhdrbox| with the default alignment. The right header has two \verb|\fancyhdrbox|es, one with an explicit width of 4cm, the second one with its natural width.
\textbf{Header definition:}
\begin{verbatim}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\sffamily
\fancyhdrbox{\includegraphics[height=3\normalbaselineskip]{example-image}}}
\fancyhead[R]{%
\fancyhdrbox[][4cm]{Our Office \\ Street 1 \\ City1 }%
\fancyhdrbox[l]{ Our Factory \\ Street 2 \\ City2 }
}
\end{verbatim}
\kant[1-2]
\end{document}