3

Is there any package that allows for the display of layout marks within a document where the layout changes several times throughout? I'm using the geometry facilities to issuing \newgeometry commands throughout my document, but it doesn't update the displayed layout and neither does the showframe package or the facilities of the memoir class.

EDIT: As Werner has pointed out, the showframe option of the geometry package displays correctly any updated page layout set by issuing \newgeometry commands.

My trouble came out of the fact that I'm issuing also \pagecolor commands and the page color seems to be hiding the layout lines typeset according to the geometry package. My confusion only worsened because the showframe package layout lines were not hidden by the page color (the package got the layout wrong on some pages, though). So, it all boils down to a conflict with the page color.

Even though I'm using geometry's showframe option for "debugging" ends, and I don't mind to have no page color at that stage of development, is it possible to override this problem and have at the same time both the page layout displayed by geometry as well as the page colored?

Btw, should I open a new question given that the problem is actually different from the originally posted one?

1

In response to your request "It's not crop marks that I'm interested in, but the different layout areas, such as textblock, header and footer, and margin notes."

To see the different page measures, I consulted the "Normal Layout" image at "Killmargins" package?

\documentclass{article}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{This is also a header test}
\fancyfoot[C]{This is also a footer test}
\AddEverypageHook{\hbox{\color{blue!40}\smash{\hspace{\oddsidemargin}%
  \rule[-\textheight-\headsep-\headheight-\topmargin]{\textwidth}{\textheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!30}\smash{\hspace{\oddsidemargin}%
  \rule[-\headheight-\topmargin]{\textwidth}{\headheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!20}\smash{\hspace{\oddsidemargin}%
  \rule[-\textheight-\headsep-\headheight-\topmargin-\footskip]{\textwidth}{\headheight}%
}}}
\AddEverypageHook{\hbox{\color{blue!10}\smash{\hspace{\oddsidemargin}%
  \hspace{\textwidth}\hspace{\marginparsep}%
  \rule[-\textheight-\headsep-\headheight-\topmargin]{\marginparwidth}{\textheight}%
}}}
\begin{document}
\lipsum[1]\marginpar{this is a margin test}
\lipsum[2-7]
\end{document}

enter image description here

EDITED to present each text region as a different hook, and in a different color saturation.

REEDITED to account for the 2018.12.01 TeX kernel changes to \smash.

0

A new page layout is shown by the showframe option of geometry:

\documentclass[a5paper]{article}
\usepackage[showframe]{geometry}
\usepackage{blindtext}
\begin{document}
\blindtext[4]
\newgeometry{rmargin=5cm}
\blindtext[4]
\restoregeometry
\blindtext[4]
\end{document}

enter image description here

  • Please, see my EDIT. I was confused about the actual origin of the problem. Should I open a new question? – Marcos Mar 4 '14 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.