How can I display (draw) a picture next to the page number.
At best, the "style" of the picture would be calculated automatically, depending on the current page number, e.g., draw a circle on even page numbers and a square on odd ones.
How can I display (draw) a picture next to the page number.
At best, the "style" of the picture would be calculated automatically, depending on the current page number, e.g., draw a circle on even page numbers and a square on odd ones.
You can change the footer or header where the page number is displayed using e.g. the fancyhdr
package which also permits to have different headers for odd and even pages.
Minimal example:
\documentclass{book}
\usepackage{fancyhdr}
\fancyfoot[CE]{\thepage\rlap{ $\circ$}}
\fancyfoot[CO]{\thepage\rlap{ $\Box$}}
\pagestyle{fancy}
\usepackage{amssymb}% for \Box symbol
\usepackage{lipsum}% for example text
\begin{document}
\lipsum[1-100]
\end{document}
However, this only works for double-sided formats. In single-sided ones fancyhdr
only takes one format. You have to make the distinction by yourself:
\documentclass{article}
\usepackage{fancyhdr}
\fancyfoot[C]{\thepage\rlap{ \ifodd\value{page}$\Box$\else$\circ$\fi}}
\pagestyle{fancy}
\usepackage{amssymb}% for \Box symbol
\usepackage{lipsum}% for example text
\begin{document}
\lipsum[1-100]
\end{document}
Just substitute $\Box$
and $\circ$
with the pictures you want. I placed them inside \rlap
so that the lap over to the right, i.e. the officially do not take space. This way the do not interfere with the centering of the page number.
Inside the header and footer it should be safe to use \value{page}
directly. Inside normal text it doesn't hold the correct value yet, because the macro is read before the decision is made if the text fits on the current page or has to go to the next one. However AFAIK the header and footer are added after the page was assembled and \value{page}
should hold the correct value.
\documentclass[a5paper]{scrbook}
\renewcommand\thepage{%
\ifthispageodd{\arabic{page}\rlap{\rule[-\dp\strutbox]{50pt}{\normalbaselineskip}}}
{\llap{\rule[-2cm]{20pt}{2cm}}\arabic{page}}}
\usepackage{lipsum}
\begin{document}
\lipsum[1-100]
\end{document}