Often I have to create two documents with the same content but different layout: one version to print and another as a digital document. Therefore some small changes have to be made like other margins, page numbering, document settings from oneside --> twoside etc.
Up till now, I compile the document two times to get both the documents right. It would be much easier if I could just define two pagestyles (let's say print and display) and automatically run the compilation two times (one time with each pagestyle) so I get the two different pdf-files I need.
I have been reading some similar threads on this already, but couldn't make anything out of it. Could someone please help me out?
The code I use to define the layout for the printed document is:
\documentclass[10 pt, a4paper, twoside, openright]{book}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{vmargin=2.5cm, inner=3cm, outer=2cm, headheight=11pt}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[RE]{\small\nouppercase{\textbf{\textit{\leftmark}}}}
\fancyhead[LO]{\small\nouppercase{\textit{\rightmark}}}
\fancyfoot[LE,RO]{\thepage}
The display version uses this layout settings:
\documentclass[10 pt, a4paper, oneside, openany]{book}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{margin=2.5cm, headheight=11pt}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\small\nouppercase{\textbf{\textit{\leftmark}}}}
\fancyfoot[R]{\thepage}
make
file, or bat-file, that runs LaTeX multiple times with different flags. You would just have to push a button once.