Suppose you have a short document (including a fancy header) which occupies only a small part of a DIN A4 page, like in this example:
\documentclass[a4paper, 12pt]{article}
\usepackage[top=2cm,hmargin=2.2cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\small \today}
\fancyhead[L]{\small header}
\fancyfoot[C]{}
\begin{document}
short text short text short text short text short
text short text short text short text short text short
text short text short text short text short text short
text short text short text short text short text short
text short text short text short text short text end of the text.
\end{document}
Suppose I want to print this text 50 times. To save paper I would print it and use a photocopier to copy this text incl. fancy header several times to one sheet of paper.
Now my question is, if there is a simple LaTeX way to do this, i.e. in the above example, have as many copies of all text from fancy header to "end of the text" automatically on a DIN A4 sheet as you can fit on it?
Best Answer
I do not know an fully automatically way, but it is possible to do it manually with minimal adjustments.
First way:
Reduce the height of the page to the minimal height by replacing
a4paper
withpagewidth=21cm,pageheight=4cm
(here 21cm is the A4 width and 4cm depends on the text content and margin requirements).Then create a second small LaTeX document which includes the PDF of the first using the
pdfpages
pages and places it multiple times on one page:This places the first document (called
mainfile.tex/.pdf
here) seven times on page. Adjust both the number of1,
and the number ofnup=1x
to the real number which fit on one page.Example Result:
Second way:
You could create the headers using normal text instead so it can be repeated over the page. A tabular would be adequate here. Putting the main text into one multi-column cell also prevents page breaks inside the text. The the text could be repeated using a loop. Adjust the
\vspace
s and the repeat numbers to fit your requirements.