Cecil Westerhof wrote:
> I have a document that I want to create as A4, but also as two A5 on
> an A4. (The same document, but shrinked.)
> Is this possible with latex?
>
> I am using lualatex if that makes a difference.
Assume you have a document in A4/portrait:
MyDocument.tex :
\documentclass[a4paper,twoside]{article}
%===================[adjust margins/layout for the example]====================
% Margins: horizontal recto (usually righthand-page whose number is odd):
% left margin: 1cm, right margin: 2cm 1cm
% horizontal verso (usually lefthand-page whose number is even):
% left margin: 2cm, right margin:
% vertical: top-margin: 1.5cm, bottom-margin: 1.5cm
% (This way the ratio
% larger horizontal margin : top/bottom-margin : smaller horizontal margin
% is 2:3:4 ,)
% Pagestyle plain with no headheight and no headsep as there won't be any
% pages with page-headers.
% \flushbottom.
%------------------------------------------------------------------------------
% Additional infrastructure:
\newlength\bottommargin
\newbox\scratchbox
\newcount\pagelineamount
%------------------------------------------------------------------------------
% Page style:
\pagestyle{plain}%
\headheight=0pt
\headsep=0pt
%------------------------------------------------------------------------------
% Margins:
\evensidemargin=2cm
\oddsidemargin=.5\evensidemargin
\topmargin=1.5\oddsidemargin
\bottommargin=\topmargin
%..............................................................................
% Margin-paragraphs:
% - Shall go into outer/wider margins:
% (Left and right margin are not of equal width.
% Thus each time you switch via \normalmarginpar and \reversemarginpar
% you need to recalculate \marginparwidth.)
\marginparsep=.2\evensidemargin
\marginparwidth=\evensidemargin
\advance\marginparwidth-2\marginparsep
% Distance of bottom-line of text-block on page to baseline of page-number
% in footer:
\footskip=.5\bottommargin
{% assuming footer contains only page numbers in arabic digits in normalfont:
\setbox\scratchbox=\hbox{\normalfont 1234567890}%
\global\advance\footskip.5\ht\scratchbox
\global\advance\footskip-.5\dp\scratchbox}%
%..............................................................................
% Adjust parameters to TeX's peculiarities:
\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%
\textwidth=\paperwidth
\advance\textwidth-\oddsidemargin
\advance\textwidth-\evensidemargin
\advance\oddsidemargin-1in
\advance\evensidemargin-1in
\textheight=\paperheight
\advance\textheight-\topmargin
\advance\textheight-\bottommargin
\advance\textheight-\headheight
\advance\textheight-\headsep
\advance\topmargin-1in
{% adjust \topskip=the distance of the baseline of the first line of text
% to the baseline of the page-header
\setbox\scratchbox=\hbox{\normalfont 1234567890%
abcdefghijklmnopqrstuvwxyz%
ABCDEFGHIJKLMNOPQRSTUVWXYZ}%
\global\topskip=\ht\scratchbox}%
\flushbottom
%==================[eof margin-adjustments]====================================
\usepackage{lipsum}
\begin{document}
\noindent\lipsum[1][1-10]
\marginpar{Some margin paragraph.}
\lipsum[2-17]
\marginpar{Some margin paragraph.}
\lipsum[18-55]
\lipsum[56][1-3]
\end{document}
You can use this for creating an A5-booklet from it which can be printed:
MyDocumentA5booklet.tex
% This is just an a4-paper document with no margins at all where pdfpages'
% \includepdf is used for including an A4-portrait pdf-file as A5-bookert.
%
\documentclass[a4paper]{article}
%============[adjust margins/layout so that there are no margins]=============
\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%
\textwidth=\paperwidth
\oddsidemargin=0cm
\marginparsep=0cm
\marginparwidth=0cm
\advance\textwidth-2\oddsidemargin
\advance\oddsidemargin-1in
\evensidemargin=\oddsidemargin
\textheight=\paperheight
\topmargin=0cm
\footskip=0cm
\advance\topmargin-1in
\headheight=0ex
\headsep=0ex
\pagestyle{empty}%
\parindent=0ex
\parskip=0ex
%==================[eof margin-adjustments]====================================
\usepackage{pdfpages}
%..............................................................................
\begin{document}
% In case you wish to obtain a stack of a4 paper that you can all together
% fold in half to get an A5 booklet:
\includepdf[nup=1x2, landscape, pages=-, booklet]{MyDocument.pdf}%
\end{document}
Sincerely
Ulrich