General ⇒ Creating customized headers/footers for alternating pages
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Creating customized headers/footers for alternating pages
http://www.latex-community.org/viewtopi ... ader#p3274
http://www.latex-community.org/viewtopi ... ader#p3040
I also downloaded and read the fancyhdf documentation from CTAN.org.
I'm creating a manual that will be put together in book form, so the product name should appear in the header in tiny text, on the left side in even pages and on the right side in odd pages.
The footer should contain the number, copyright info and the words "User Guide" on every page, but the page number should be on the left on even pages and on the right on odd pages, switching places with "User Guide".
I can put the appropriate information in the header and footer now, but need to know how to make that information change, depending on odd and even pages.
Thanks for help with yet another puzzle.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Creating customized headers/footers for alternating pages
Code: Select all
\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{\tiny\bfseries The product}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,RE]{User Guide}
\fancyfoot[C]{Other information}
\usepackage{lipsum}
\begin{document}
\lipsum[1-40]
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Creating customized headers/footers for alternating pages
Code: Select all
% Page style settings (fancyhdr)
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,RE]{User's Guide \copyright\ Copyright Information}
\fancyhead[RE]{\sffamily\nouppercase{\rightmark}}
\fancyhead[LO]{\sffamily\nouppercase{\leftmark}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
%\addtolength{\headheight}{2pt}
%\addtolength{\footheight}{2pt}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Creating customized headers/footers for alternating pages
Code: Select all
\begin{document}
%Make title page without date and insert logo on top of the title
\begin{titlepage}
\begin{center}
% Upper part of the page
\includegraphics[width=0.8\textwidth]{img/logo_large.png}\\[1cm]
\textcolor{red}{\textsc{\Huge \textbf{User Guide}}}\\[1cm]
\end{center}
\end{titlepage}
\pagenumbering{roman}
%Create a copyright page as a separate page
\vspace*{\fill}
\begingroup
\centering
\textbf{Copyright \copyright 2008}\\
by Copyright Stuff.\\
All Rights Reserved\\
\endgroup
\vspace*{\fill}
\newpage
% Insert the table of contents
\tableofcontents
% Set indent of paragraphs to zero
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
\newpage
\pagenumbering{arabic}
%Chapter 1

Creating customized headers/footers for alternating pages
I do not see how this is possible. We both gave you suggestions; you only had to adapt them to your particular needs.tripwire45 wrote:I think I like gmedina's solution better (no offense, Thorsten)...
Anyway, try using the openany class option; i.e., use something like
Code: Select all
\documentclass[openany]{book}
- tripwire45
- Posts: 129
- Joined: Thu Apr 10, 2008 4:35 am
Creating customized headers/footers for alternating pages
Thanks. It works.gmedina wrote:I do not see how this is possible. We both gave you suggestions; you only had to adapt them to your particular needs.[\quote]tripwire45 wrote:I think I like gmedina's solution better (no offense, Thorsten)...
What I mean to say is that your suggestion is more suited to my needs.
gmedina wrote:Anyway, try using the openany class option; i.e., use something likeCode: Select all
\documentclass[openany]{book}