forked from CryHavoc/dottes
Round A4 up to a multiple of 4 total pages.
I can't easily get the number of actual pages processed, so rely on telling the (rather hacky, and surprising - I have to divide to a separate counter to force an integer result) macro the number of pages used before the current numbering started.
This commit is contained in:
parent
66b6858437
commit
e7f4b4995f
|
@ -1,3 +1,4 @@
|
|||
\padpages{4}{8}
|
||||
\pagecolor{havocpurple}
|
||||
\thispagestyle{empty}
|
||||
\mbox{}
|
||||
|
|
24
dottes.tex
24
dottes.tex
|
@ -1,11 +1,13 @@
|
|||
\input{docclass.tex}
|
||||
|
||||
\usepackage{array}
|
||||
\usepackage{calc}
|
||||
\usepackage{caption}
|
||||
\usepackage{color}
|
||||
\usepackage{fontspec}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{ifthen}
|
||||
\usepackage[defaultlines=4,all]{nowidow}
|
||||
\usepackage{tabularx}
|
||||
\usepackage{longtable}
|
||||
|
@ -98,6 +100,28 @@
|
|||
\end{figure}
|
||||
}
|
||||
|
||||
% Add blank pages to make total page count up to a multiple
|
||||
% Args are:
|
||||
% 1. Multiple desired
|
||||
% 2. Pages before start of current page count
|
||||
\newcounter{modpage}
|
||||
\newcounter{modpageno}
|
||||
\newcounter{modpagenodiv}
|
||||
\newcommand{\padpages}[2]{%
|
||||
\pagestyle{empty}%
|
||||
\setcounter{modpageno}{\thepage + #2}%
|
||||
\setcounter{modpagenodiv}{\themodpageno/#1}%
|
||||
\setcounter{modpage}{\themodpageno - #1*\themodpagenodiv}%
|
||||
\ifthenelse{\themodpage=0}%
|
||||
{\relax}%
|
||||
{\setcounter{modpage}{#1 - \themodpage}%
|
||||
\whiledo{\themodpage>0}{%
|
||||
\mbox{}\clearpage\mbox{}%
|
||||
\setcounter{modpage}{\themodpage - 1}%
|
||||
}% end whiledo
|
||||
}% end ifthenelse
|
||||
}% end padpages
|
||||
|
||||
% ----- Paper size document setup
|
||||
|
||||
\input{docsetup.tex}
|
||||
|
|
Loading…
Reference in New Issue