def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=None,
- cover=None, cover_file=None, flags=None, customizations=None, documentclass='wl', resources=None):
+ cover=None, cover_file=None, flags=None, customizations=None, documentclass='wl', resources=None, tworuns=False):
""" produces a PDF file with XeLaTeX
wldoc: a WLDocument
if resources:
os.putenv("TEXINPUTS", "::.:%s" % resources)
- if verbose:
- p = call(['xelatex', tex_path])
- else:
- p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE)
- if p:
- raise ParseError("Error parsing .tex file")
+ for run in range(1 + (tworuns and 1 or 0)):
+ if verbose:
+ p = call(['xelatex', tex_path])
+ else:
+ p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE)
+ if p:
+ raise ParseError("Error parsing .tex file")
if cwd is not None:
os.chdir(cwd)
\makeatother
\nochapternumbers
-\startcontents[chapter]
+%\startcontents[chapter] % ??? XXX
\newcommand{\chapterblock}[1]{%
\clearpage%
\begin{minipage}[t][\dimexpr\textheight-28pt\relax]{\dimexpr\szpaltawidth-5mm\relax}%
\Huge{}\headfont\color{white}#1%
\vspace{\dimexpr21mm-11mm\relax}%
-\par{\printcontents[chapter]{}{1}{}}
+\par{\color{white}\printcontents[chapter]{}{1}{}}
\end{minipage}%(testing)%\rule{0.1pt}{\baselineskip}%
\hspace{2.5mm}}%
\vspace{\dimexpr-\parskip-11pt\relax}%
\renewcommand*\contentsname{Spis treści}
\newcommand{\spistresci}{
{
- \setcounter{tocdepth}{0}
+% \setcounter{tocdepth}{0}
\tableofcontents
\newpage
}
help='LaTeX document class options'),
Option('-e', '--cover-file', dest='cover_file', metavar='FILE',
help='Cover image file'),
+ Option('-2', '--two-runs', dest='tworuns', action='store_true', default=False,
+ help='two runs of (Xe)Latex'),
]