32

Is there a way to draw a rectangle around every page?

The problem is that my document (a Ph.D. thesis) is in a funny format (16x24cm). So to print it centered on A4 paper (for reviewing) I played with the page layout.

However, I would like to have indication of the true page size with means of a rectangle drawn around each page. Is it possible? BTW. I use pdflatex.

5 Answers 5

42

You can use the crop package to place your pages on a A4 paper. It can center and frame it for you:

\documentclass{article}
\usepackage[paperwidth=16cm,paperheight=24cm]{geometry}
\usepackage[a4,frame,center]{crop}

\usepackage{lipsum}% dummy text
\begin{document}
\lipsum
\lipsum
\lipsum
\end{document}

It looks like this:

Result

If you don't like the info line above the frame use the noinfo package option.

5
  • Ui, the package works great, but synctex gets confused... Any idea how to make both crop and synctex-pdf-linking to work together?
    – ronszon
    Apr 11, 2011 at 16:28
  • @ronszon: Sorry, I can't help you here. I never used synctex so far. You might ask this as a follow-up question. Apr 11, 2011 at 16:30
  • 1
    @MartinScharrer is there a way to change color and thickness of this borer?
    – Dion
    Jul 25, 2014 at 22:06
  • I can use the command without the center as it appears above, which I would like: \usepackage[a4,frame]{crop} This way I can make the border to appear as a single line at the bottom. Is it possible to place just a single line below for cutting (instead of a complete square border) ?
    – nilon
    Mar 3, 2017 at 19:27
  • @nilon: Well, please check the manual of crop if it support such a thing. All I could do is doing the exact same thing. Mar 15, 2017 at 21:34
11

If you are using geometry for setting the page parameters, then add the option showframe or showcrop

4
  • 1
    geometry doesn't seem to have a showcrop option. Oct 2, 2011 at 5:52
  • 1
    @FaheemMitha Version 5.6 has it.
    – egreg
    Oct 2, 2011 at 9:07
  • egreg: Ok. I am using 4.2 (Tex Live 2009). Oct 2, 2011 at 13:18
  • This way is excellent to remove (large amounts of) badboxes from the draft of a (large sized) document. Aug 5, 2014 at 7:32
11

I had a similar issue with my own thesis. The way I dealt with it issue was to use features of the PDF format. PDF allows a file to specify several different boxes: TrimBox, MediaBox, ArtBox, CropBox, BleedBox. Relevant to this situation is MediaBox: the size of the paper you are printing on (in your case A4); and TrimBox: the size of the page after trimming. Many PDF viewers (Adobe Reader for example) are able to display these boxes optionally. I don't know of any packages that make use of this feature (would make a nice modification to geometry or crop), so I did it by hand: \pdfpageattr{/TrimBox[9 9 621 801]} where if I recall correctly the units are in pts. You can see a result here, where I wanted the final page to be US Letter size, but to have a 0.125" bleed before trimming. If you are using Adobe Reader, then to show the boxes use Edit -> Preferences -> Page Display -> Show art, trim, & bleed boxes.

4

The crop packages does it for the general case. See also What is the easiest way to get borders around a page in LaTeX? and in particular the solution for the Memoir document class.

2

try using this :

\usepackage{pgf}
\usepackage{pgfpages}
%
\pgfpagesdeclarelayout{boxed}
{
  \edef\pgfpageoptionborder{3pt}
}
{
  \pgfpagesphysicalpageoptions
  {%
    logical pages=1,%
  }
  \pgfpageslogicalpageoptions{1}
  {
    border code=\pgfsetlinewidth{0.5pt}\pgfstroke,%
    border shrink=\pgfpageoptionborder,%
    resized width=.95\pgfphysicalwidth,%
    resized height=.95\pgfphysicalheight,%
    center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
  }%
}
\pgfpagesuselayout{boxed}
\setlength{\parindent}{2cm}
3
  • Can you extend the question by some explanations and maybe a screenshot?
    – Johannes_B
    Oct 12, 2014 at 14:23
  • 1
    Ideally, write up a minimal working example (MWE) to show its use, rather than just code snippets.
    – Werner
    Oct 12, 2014 at 14:35
  • This solution causes page numbers in the table of contents to be off by 1 May 13, 2020 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .