Page Layoutframe around page and header/footer

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
perski1234
Posts: 2
Joined: Sun Jan 06, 2013 6:26 pm

frame around page and header/footer

Post by perski1234 »

Hi,

I am new to the LaTeX Community.
I want to frame the entire page as well as header and footer of my latex document. Unfortunately, I do not know how it works. Please find attached an example.

Thank you very much in advance for your answer, LaTeX Community.

Perski1234
Attachments
example.pdf
(95.63 KiB) Downloaded 1281 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

frame around page and header/footer

Post by Stefan Kottwitz »

Hi Perski,

welcome to the board!

Do you have any code to start? Which document class do you use? It would be good to show compilable sample code, readers her could help to add to it.

Framing a page and drawing rectangles on page parts could be done with TikZ, as one possibility. Here's an example with framed page plus extras: Exam sheet. You could take and modify this code.

Stefan
LaTeX.org admin
perski1234
Posts: 2
Joined: Sun Jan 06, 2013 6:26 pm

frame around page and header/footer

Post by perski1234 »

Hi,

thanks for the reply! I am able to draw several rectangles, but still have some questions.
1) How can I place text notes?
2) Is it possible to have the TikZ-drawing as global presetting and how can I achieve this?

I want to have framed pages (the entire document) and use it as a normal Latex document.

Code: Select all

\documentclass[12pt]{report}

\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\evensidemargin 0cm
\oddsidemargin 0cm
\textwidth 16cm
\textheight 24cm
\topmargin -1cm

\begin{document}
\begin{tikzpicture}
	\draw (-8,12) rectangle (8,-12);
	\draw (-8,12) rectangle (-4,9);
	\draw (-4,12) rectangle (4,9);
	\draw (4,12) rectangle (8,9);
\end{tikzpicture}
\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

frame around page and header/footer

Post by Stefan Kottwitz »

  1. With TikZ you can place nodes with text inside, at absolute positions too, also with \draw.
  2. In such cases I
    • defined a page style using fancyhdr, scrpage2 or titleps (choose one which you already know)
    • put the tikzpicture commands into a header command, such as in \chead or fancyhead - it doesn't matter which, since the position is absolute
    • used overlay options:
      \begin{tikzpicture}[remember picture, overlay]
Have a look at the example of the exam sheet linked above, and at Fancy chapter headings with TikZ, there are examples, which at least should give you a point to start.

Stefan
LaTeX.org admin
Post Reply