7

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?

4
  • The buzzword for that is thumb index. You can search on this site too.
    – percusse
    Mar 27, 2013 at 9:42
  • 1
    although the instructions for doing it were not included in the article, figures in the tugboat article "There is no end: Omega and Zapfino" by William Adams were laid out in such a way that the "signature" of zapfino was progressively composed as a flip-book animation. Mar 27, 2013 at 13:44
  • In the fancyhdr documentation this feature is discussed.
    – yo'
    Mar 27, 2013 at 15:34
  • That's a typical feature of Hans Hagen's ConTeXt presentations - he does it with MetaFun. Mar 28, 2013 at 12:51

2 Answers 2

4

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}

enter image description here

3
  • 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.
    – percusse
    Mar 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.
    – DennisH
    Mar 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.
    – percusse
    Mar 27, 2013 at 16:26
4

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}

enter image description here

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.