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

I need a border style that has a nice appearance. I've found something like this:



\usepackage{lipsum}% dummy text

\begin{tikzpicture}[overlay,remember picture]
    \draw [line width=1mm,decorate%,decoration={snake
        %,segment length=<length>,amplitude=<length>
%        }
        ($ (current page.north west) + (0.3cm,-0.3cm) $)
        ($ (current page.south east) + (-0.3cm,0.3cm) $);
    \huge Ejemplo de margenes


But it looks neither beautiful nor formal. Perhaps something like this:

\usepackage{fancybox}% http://ctan.org/pkg/fancybox
\usepackage{lipsum}% http://ctan.org/pkg/fancybox



But I don't know how to set the margin to the complete document.

share|improve this question
up vote 9 down vote accepted

You could use the background package to add your frame to all (or to some of) the pages of your document; a simple example producing a rounded double frame:


\begin{tikzpicture}[overlay,remember picture]
    \draw [line width=1pt,rounded corners=15pt,double]
        ($ (current page.north west) + (2.5cm,-2.5cm) $)
        ($ (current page.south east) + (-2.5cm,2.5cm) $);

share|improve this answer

Do you think that this PDF is what you want? Its source can be downloaded from Here.

The typesetted material is a Persian poem from Shahnameh.

This is typeset using xepersian package in xelatex.

share|improve this answer
This is an excellent example, where borders can be an exception. As the example emulates a manuscript this is very well suited and gives it a taste of the period. Just don't do your maths paper with a frame like this:) – Yiannis Lazarides Nov 13 '11 at 8:27

Gonzalo's answer as to how to get the round corners is fine. Just to add a few comments on the typography.

But it looks neither beautiful nor formal.

The reason is that any fancy decorations you put on pages detract from the text being in harmony with the white space of the margins. Books don't normally get printed with framed pages. It is only in some corporate environments that you find such distasteful typographical examples, which you should not emulate. Here are two images, one framed and another not framed.

enter image description hereenter image description here

Even after reducing the line thickness to 1pt, the framed option still does not look right. Please don't use it. The code I used (as per Gonzalo's full MWE) for the frame is:

\begin{tikzpicture}[overlay,remember picture]
    \draw [line width=1pt,rounded corners=15pt]
        ($ (current page.north west) + (.5cm,-.5cm) $)
        ($ (current page.south east) + (-.5cm,.5cm) $);

Margins are normally set with the geometry package. I set them in the example as:

share|improve this answer
It is a matter of personal taste, but I like the borders (with background colors) used in the ConTeXt details manuals – Aditya Nov 13 '11 at 6:16
@Aditya The shading makes the difference as well as the overall design of the manual, but as you said is a matter of personal taste. I just don't believe that generally a border serves any function and therefore shouldn't be there in the first place. In the manual it serves a purpose as it indicates the textarea you are working on. – Yiannis Lazarides Nov 13 '11 at 8:32

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.