I once saw a document with pictures in the top corner. If you rapidly thumb thru the document the pictures appear to move. Is there a way to put a series of thumbnails in the top corner of a document?
2 Answers
You can place figures, according to page number.
I simply saved the first Google image result to the queries pretty image 1,2,...
in the folder of the .tex
file, named them 1.jpg, 2.jpg,... and ran:
\documentclass[paper=a6,pagesize]{scrartcl}
\usepackage{fancyhdr}
\usepackage{graphicx}
\rhead{\includegraphics[height=0.6cm]{\thepage}}
\pagestyle{fancy}
\usepackage{lipsum}
\begin{document}
\lipsum\pagebreak
\end{document}
The result is shown below. With the proper pictures you can achieve your comic strip animation.
If you want the images really really in the corner (watch out for overlay with the thumb), you can use the following code.
\documentclass[paper=a6,pagesize]{scrartcl}
\usepackage{fancyhdr}
\usepackage{tikz}
\rhead{\tikz[overlay,remember picture]\node at (current page.north east) [anchor=north east] {\includegraphics[height=0.6cm]{\thepage}};}
\pagestyle{fancy}
\usepackage{lipsum}
\begin{document}
\lipsum\pagebreak
\end{document}
-
Instead of nonexisting pictures you can put
\thepage
inside the node text with some fill option to the node. If that works images work too anyway.– percusseMar 27, 2013 at 15:33 -
@percusse The question is about flip-book animations, not about fancy page numbering. I only used numbers to prove the validity of the counter and because I did not find anything pretty and witty. A TikZ-based animation sure would be nice, but exceeds the range of the question. I did not want to over-complicate the answer though.– DennisHMar 27, 2013 at 16:23
-
I only meant that the MWE you provided requires external pictures. It's a good practice to supply a compilable code. That's it. I don't mean to change the code. You can even move the thumb index with a
\thepage
based shift amount so it moves on the long edge.– percusseMar 27, 2013 at 16:26
Here's another possibility using the background
package (I assumed the images files are called image-1
, image-2
,...):
\documentclass[paper=a6,pagesize]{scrartcl}
\usepackage{background}
\usepackage{graphicx}
\backgroundsetup{
angle=0,
position=current page.north east,
hshift=-10pt,
vshift=-10pt,
scale=1,
color=black,
opacity=1,
contents={\includegraphics[width=20pt]{image-\thepage}}
}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
Rereading the question, it is natural that the images must appear only on odd-numbered pages for a two-sided document; this can also be easily achieved with the background
package.
Assuming once again that the images are called image-1
, image-2
,... then image-k
must appear on page 2k-1
so some arithmetic has to be done; for this, I used the \dividecounter
macro proposed by egreg in his answer to design a macro that replaces \divide:
\documentclass[paper=a6,pagesize]{scrartcl}
\usepackage{background}
\usepackage{ifthen}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{calc}
\backgroundsetup{
angle=0,
position=current page.north east,
hshift=-10pt,
vshift=-10pt,
scale=1,
color=black,
opacity=1,
contents={}
}
\newcounter{imagenumb}
\newcommand\dividecounter[2]{%
\global\divide\csname c@#1\endcsname#2\relax}
\AddEverypageHook{%
\setcounter{imagenumb}{\numexpr\thepage+1\relax}
\dividecounter{imagenumb}{2}
\ifthenelse{\isodd{\thepage}}%
{\backgroundsetup{contents={\includegraphics[width=20pt]{image-\theimagenumb}}}%
{}%
\BgMaterial}%
}
\begin{document}
\lipsum[1-12]
\end{document}
thumb index
. You can search on this site too.fancyhdr
documentation this feature is discussed.