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.


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) $);


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.

  • 6
    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:

  • 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 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.