Skip to content

Instantly share code, notes, and snippets.

@Abdelkrim
Created February 15, 2020 16:01
Show Gist options
  • Save Abdelkrim/34a53994e200528a010b334dcbb25425 to your computer and use it in GitHub Desktop.
Save Abdelkrim/34a53994e200528a010b334dcbb25425 to your computer and use it in GitHub Desktop.
sphinx, conf.py, generate nice looking PDF file and reading the PREAMBLE latex-styling.tex
# -- Options for LaTeX output ------------------------------------------------
f = open('latex-styling.tex', 'r+')
PREAMBLE = f.read()
latex_elements = {
# https://www.sphinx-doc.org/en/master/latex.html
# 'classoptions': ',openany,twoside',
'classoptions': ',openany',
# 'babel' : '\\usepackage[french]{babel}',
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
#
'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
'preamble': PREAMBLE,
'maxlistdepth': '10',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'figure_align': 'H',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment