Page Layoutworking with geometry and fancyhdr packages

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
dcernst
Posts: 19
Joined: Sun Aug 29, 2010 9:50 pm

working with geometry and fancyhdr packages

Post by dcernst »

I'm currently updating my CV and I am trying to mimic the CV found at

http://www.tedpavlic.com/post_resume_cv ... xample.php

This particular example modifies the margins so that the section titles will go in the left margins.

Here is a minimal example that illustrates the problem that I am having:

Code: Select all

\documentclass[11pt]{article}
\usepackage{calc}
\usepackage[breaklinks]{hyperref}

\usepackage{fancyhdr}

\reversemarginpar

\usepackage[paper=letterpaper,
            marginparwidth=1.2in, 
            marginparsep=.05in, 
            margin=1in,
            includemp]{geometry}

\setlength{\parindent}{0in}

\pagestyle{fancy}

\lhead{{\Large \textbf{Bat Man}}}

\renewcommand{\section}[2]%
        {\pagebreak[2]\vspace{1.3\baselineskip}%
         \phantomsection\addcontentsline{toc}{section}{#1}%
         \hspace{0in}%
         \marginpar{
         \raggedright \scshape #1}#2}

\begin{document}

\section{Contact Information}
Bat Cave, Gotham City

\newpage

\section{Favorite Buddies}
Robin and Bat Girl

\end{document}
What I would like to have is for the fancy header to be as wide as the total width of both columns (which is something like \textwidth+\marginparwidth+\marginparsep).

The example that I started to mimic uses the following code to accomplish what I am looking for:

Code: Select all

\newcommand{\makeheading}[1]%
        {\hspace*{-\marginparsep minus \marginparwidth}%
         \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
                {\large \bfseries #1}\\[-0.15\baselineskip]%
                 \rule{\columnwidth}{1pt}%
         \end{minipage}}
The problem with this is that it only puts the header on the first page and I'd like to put it on every page. I'm hoping that I can modify the options for fancyhr to accomplish this.

Thanks in advance for any help!
Last edited by dcernst on Sun Oct 31, 2010 3:19 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

dcernst
Posts: 19
Joined: Sun Aug 29, 2010 9:50 pm

Re: working with geometry and fancyhdr packages

Post by dcernst »

By the way, I'm welcome to suggestions that accomplish what I'm looking for that do not involve modifying the fanyhdr options. However, I'd rather not use the res document class.
dcernst
Posts: 19
Joined: Sun Aug 29, 2010 9:50 pm

working with geometry and fancyhdr packages

Post by dcernst »

The following minimal example achieves the output that I was hoping for:

Code: Select all

\documentclass{article}

\usepackage{calc}

\reversemarginpar
\usepackage[paper=letterpaper,
           marginparwidth=1.2in,     
           marginparsep=.05in,       
           hmargin={.75in,.75in},
           vmargin=1in,           
           includemp]{geometry}
\usepackage{fancyhdr}
\fancyheadoffset[LO,LE]{\marginparsep+\marginparwidth}
\fancyfootoffset[LO,LE]{\marginparsep+\marginparwidth}

\setlength{\parindent}{0in}

\pagestyle{fancy}

\lhead{{\Large \textbf{Batman}}}

\renewcommand{\section}[2]{\hspace{0in}\marginpar{\raggedright \scshape #1}#2}

\begin{document}

\section{Contact Information}
Bat Cave, Gotham City

\newpage

\section{Favorite Buddies}
Robin and Batgirl

\end{document}
Post Reply