aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2011-04-21 18:01:59 +0200
committerElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2011-04-21 18:01:59 +0200
commit53307f88fcceedceb3f2b66fc05020f65e654ac6 (patch)
tree6895077a6bc978748c8e2c3715b6bebc94e581d7
parent0a2be34e9e2bf6e9e9ef023dd36088733007e155 (diff)
template per la generazione del file LaTeX
-rwxr-xr-xmake_guides.py9
-rw-r--r--tools/booklet-A6.template.tex15
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}