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 need a border style that has a nice appearance. I've found something like this:

\documentclass{book}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}

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

\begin{titlepage}
    \centering
\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) $)
        rectangle
        ($ (current page.south east) + (-0.3cm,0.3cm) $);
\end{tikzpicture}
    \huge Ejemplo de margenes

\end{titlepage}
\end{document}

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

\documentclass{article}
\usepackage{fancybox}% http://ctan.org/pkg/fancybox
\usepackage{lipsum}% http://ctan.org/pkg/fancybox
\begin{document}

\thisfancyput(3.25in,-4.5in){%
  \setlength{\unitlength}{1in}\fancyoval(7,9.5)}%
\lipsum[1-20]

\end{document}

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

share|improve this question
add comment

3 Answers

up vote 7 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:

\documentclass{article}
\usepackage{background}
\usepackage{lipsum}
\usetikzlibrary{calc}

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

\begin{document}
\lipsum[1-40]
\end{document}
share|improve this answer
add comment

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) $)
        rectangle
        ($ (current page.south east) + (-.5cm,.5cm) $);
\end{tikzpicture}

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

\documentclass{octavo}
\usepackage[left=1cm]{geometry}
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
add comment

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