General ⇒ A page with border
A page with border
My question is "how do I add a border (frame ?) to an entire page ?" The page may contain paragraphs, images, maths expressions, and even page numbering. I want just one or a specific number of pages to have a border all around.
What is the easiest/least cumbersome way to achieve this ? Maybe I can tweak it using \fbox{xxxxx}. Any simple example will be greatly helpful to me.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
Code: Select all
\documentclass{article}
\usepackage{blindtext}
\usepackage{background}
\usetikzlibrary{calc}
\backgroundsetup{angle = 0, scale = 1, vshift = -2ex,
contents = {\tikz[overlay, remember picture]
\draw [rounded corners = 20pt, line width = 1pt,
color = blue, fill = yellow!20, double = blue!10]
($(current page.north west)+(1cm,-1cm)$)
rectangle ($(current page.south east)+(-1,1)$);}}
\pagestyle{empty}
\begin{document}
\Blinddocument
\end{document}
A page with border
me what I wanted (see attachment border11.png). Guess I will have to struggle harder. I do not give up so easily. I will
update this forum when I reach somewhere closer to my goal.
Thanks anyway,
partha
- Attachments
-
- border11.png (45.78 KiB) Viewed 15778 times
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
Stefan
A page with border
\documentclass{article}
\usepackage{blindtext}
\usepackage{background}
\usetikzlibrary{calc}
\backgroundsetup{angle = 0, scale = 1, vshift = -2ex,
contents = {\tikz[overlay, remember picture]
\draw [rounded corners = 20pt, line width = 1pt,
color = blue, fill = yellow!20, double = blue!10]
($(current page.north west)+(1cm,-1cm)$)
rectangle ($(current page.south east)+(-1,1)$);}}
\pagestyle{empty}
\begin{document}
\Blinddocument
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
Also, if you post code, please format it as code as I did. Then it can be compiled here in the forum by the simple button click.
Finally, run the code two times. If something is placed in the backround, like here, a first LaTeX run calculates page coordinates, the second LaTeX run places it correctly based in the coordinates (from the .aux file).
Stefan