Page Layout ⇒ How to add text/image in the left/right margin on every page
How to add text/image in the left/right margin on every page
I am trying to repeat some text (or even an image) in the left and right margins of every page. I am new to LaTeX. Is there any package that will let me do this? I am aware of fancyhdr, but as far as I could see it affects only headers and footers on each page.
Thanks for your help.
Regards,
Bala.
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
How to add text/image in the left/right margin on every page
welcome to the board!
You could use atbegshi or everyshi.
As you mentioned fancyhdr: it would be possible using fancyhdr or scrpage2 as well, for example together with TikZ and the current page node. Here are examples: Fancy chapter headings with TikZ.
Stefan
How to add text/image in the left/right margin on every page
Thanks a lot for your pointers. I am able to get *almost* what I am looking for with atbegshi. Here is the code:
Code: Select all
\documentclass[12pt]{exam}
\usepackage[latin1]{inputenc}
\usepackage{atbegshi}
\usepackage{textpos}
\usepackage{shadow}
\usepackage{draftwatermark}
\usepackage{rotating}
\usepackage[english]{babel}
\usepackage{blindtext}
\TPGrid{8}{11}
\AtBeginShipout{%
\begin{textblock}{3}(-0.5,4)
\begin{turn}{-90}
Text on the left margin
\end{turn}
\end{textblock}
\begin{textblock}{3}(6,4)
\begin{turn}{-90}
Text on the right margin
\end{turn}
\end{textblock}%
}
\begin{document}
\pagestyle{headandfoot}
\header{\bfseries Txt 1}{\bfseries Txt 2}{\bfseries Txt 3}
\headrule
\footrule
\footer{}{\copyright whatever}{\thepage/\numpages}
\hfill
\shabox{\parbox[l]{2in}{X1: \\X2: August 21, 2009\\X3: }}
\blinddocument
\end{document}
Thanks for your help.
Regards,
Bala.