TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can one change the colour, pitch, line style, etc of the rules generated by the geometry package's showframe option?

share|improve this question
up vote 10 down vote accepted


Compile and read this MWE:

\def\Gm@hrule{\color{red!20}\hrule height 4pt depth\z@ width\textwidth}%
\def\Gm@vrule{\color{red!20}\vrule width 4pt height\textheight depth\z@}%
\def\Gm@hruled{\color{red!20}\hrule height\z@ depth4pt width\textwidth}%


\title{How to change the color of \texttt{showframe}}


You need change the rules. Not all those of the society, but only the three
defined in \verb|geometry.sty| with the macros 
\verb|\Gm@vrule|  \verb|\Gm@hrule| and  \verb|\Gm@hruled|. 
Thus, simply define again these rules in your preamble, adding some color. 
Of course, include before the  \verb|color| or \verb|xcolor| package.

As these commands contain the character @, remember that you need put 
these definitions in a  \verb|\makeatletter| \dots  \verb|\makeatother| group.

The rest of this the \verb|lipsum| dummy text of any decent 
minimal  working example. 
You do not need read the following text.  \lipsum[1]


share|improve this answer

The internal macro \Gm@pageframes sets the frames, thus it can be extended to add a color:



\section{Hello World}


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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