Maybe this question is answered somewhere in this forum. If so, please excuse me and give me the place I should see.
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.
LaTeX forum ⇒ General ⇒ A page with border
- Stefan Kottwitz
- Site Admin
- Posts: 9947
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
Here is an example from the LaTeX Cookbook, showing how to use TikZ for this:
Stefan
\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
LaTeX.org admin
A page with border
Thanks for the prompt clue. I know TikZ is a complex animal to tame and ride. As expected, my first attempt failed to get
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
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 142 times
- Stefan Kottwitz
- Site Admin
- Posts: 9947
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
You could also post the code that you try as a compilable example like I did. We may see what the issue is with the code.
Stefan
Stefan
LaTeX.org admin
A page with border
I tried the code exactly as you gave it, just to see what it gives:
\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}
\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: 9947
- Joined: Mon Mar 10, 2008 9:44 pm
A page with border
Click the button "Run LaTeX here" to see what my code does.
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
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
LaTeX.org admin
Who is online
Users browsing this forum: No registered users and 5 guests