diff options
-rwxr-xr-x | make_guides.py | 9 | ||||
-rw-r--r-- | tools/booklet-A6.template.tex | 15 |
2 files changed, 20 insertions, 4 deletions
diff --git a/make_guides.py b/make_guides.py index d46ba13..79184c7 100755 --- a/make_guides.py +++ b/make_guides.py @@ -59,14 +59,15 @@ def build_latex(guide): fp.close() if not os.path.isdir(build_dir): os.mkdir(build_dir) - fp = open(os.path.join(build_dir,tex_name),'wt') + fp = open(os.path.join(build_dir,tex_name),'wb') + print(tools_dir) fp.write(docutils.core.publish_string(source, writer_name='latex', - settings_overrides={'language': 'it', + settings_overrides={'language_code': 'it', 'documentoptions': 'a6paper,twoside', 'stylesheet': 'lmodern', - 'hyperlink-color': '0', - 'output_encoding': 'unicode'})) + 'template': os.path.join(tools_dir,'booklet-A6.template.tex'), + 'hyperlink-color': '0'})) fp.close() def build_pdf(guide): diff --git a/tools/booklet-A6.template.tex b/tools/booklet-A6.template.tex new file mode 100644 index 0000000..8fea814 --- /dev/null +++ b/tools/booklet-A6.template.tex @@ -0,0 +1,15 @@ +% generated by Docutils <http://docutils.sourceforge.net/> +$head_prefix\usepackage[inner=14mm,outer=14mm,top=14mm,bottom=14mm]{geometry} +\usepackage{fixltx2e} % LaTeX patches, \textsubscript +\usepackage{cmap} % fix search and cut-and-paste in PDF +$requirements +%%% Custom LaTeX preamble +$latex_preamble +%%% User specified packages and stylesheets +$stylesheet +%%% Fallback definitions for Docutils-specific commands +$fallbacks$pdfsetup +%%% Body +\begin{document} +$body_pre_docinfo$docinfo$dedication$abstract$body +\end{document} |