Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want my document to have borders in all pages. I imagine I can do that using TikZ, but is there an easier way to do it?

I also asked this question here, but as the main question was something else, this one problem got ignored (probably the use of the word "margin" rather than "border" did not help my case).

Can anyone help me?

share|improve this question
2  
A margin refers to the whitespace between the text and the edge of the paper. It sounds like you are referring to a box or a border. –  Sharpie Aug 2 '10 at 0:49
    
@Sharpie: corrected, thanks! –  Vivi Aug 2 '10 at 1:10
    
This question is ambiguous. It will be better if you attach a hand-made drawing to this question to avoid ambiguity! :-) –  xport Aug 5 '11 at 18:04
add comment

3 Answers 3

up vote 8 down vote accepted

Memoir class has option showtrims and commands \trimFrame, \settrimmedsize, \settrims. Example:

\documentclass[10pt,a4paper,showtrims]{memoir}
\trimFrame  
\settrimmedsize{210mm}{145mm}{*} 
\settrims{20mm}{34mm}
share|improve this answer
add comment

You're right that it can be done with TikZ, but it's not necessary to load in the whole of TikZ to get the bits required for this. The part that is needed is pgfpages. You can do a lot of page manipulation with this package, but here's some to get you started:

\documentclass{article}
\usepackage{pgf}
\usepackage{pgfpages}

\pgfpagesdeclarelayout{boxed}
{
  \edef\pgfpageoptionborder{0pt}
}
{
  \pgfpagesphysicalpageoptions
  {%
    logical pages=1,%
  }
  \pgfpageslogicalpageoptions{1}
  {
    border code=\pgfsetlinewidth{2pt}\pgfstroke,%
    border shrink=\pgfpageoptionborder,%
    resized width=.95\pgfphysicalwidth,%
    resized height=.95\pgfphysicalheight,%
    center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
  }%
}

\pgfpagesuselayout{boxed}
\begin{document}

Something simple

\end{document}

Of course, if you're going to use the same layout again and again, put it in a separate style file and \usepackage{mylayouts} in each document.

Note: the package pgf is only needed to provide the command \pgfstroke. As all this does is draw a line, it may be possible to remove this in favour of a \rule of some sort.

share|improve this answer
    
After trying various suggestions, this was the only one that worked well within beamer on the first shot. Thanks! –  Joe Corneli Nov 15 '13 at 22:06
    
Thanks a lot for helping. –  Coeus Wang Dec 31 '13 at 5:44
add comment

A box around your document: it sounds like a frame around your logical page on a bigger paper size. This can be done using the crop package.

share|improve this answer
add comment

Your Answer

 
discard

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.