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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10328
- 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 14585 times
- Stefan Kottwitz
- Site Admin
- Posts: 10328
- 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: 10328
- 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