-
Notifications
You must be signed in to change notification settings - Fork 1
/
_conf.py
67 lines (60 loc) · 2.1 KB
/
_conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Define the document to build with LaTeX
latex_documents = [
(
'tutorial/index',
'Tutorial-Python_Python-Argentina.tex',
u'Tutorial de Python',
_stdauthor,
'manual'
),
]
# Configure PDF building for PRINTED version of the Tutorial
# https://www.sphinx-doc.org/en/master/latex.html
latex_elements = {
'papersize': 'a5paper',
'sphinxsetup': 'verbatimwithframe=false, verbatimhintsturnover=false',
'pointsize': '9pt',
'fontpkg': r'''
\usepackage[familydefault]{Rosario}
\setmonofont{Fira Code}
\usepackage[T1]{fontenc}
''',
'geometry': r'''\usepackage{geometry}\geometry{ right=10mm, left=20mm }''',
'hyperref': r'''\usepackage[hidelinks]{hyperref}''',
'maketitle': r'''
\includepdf[pages=-]{../../../extra-pages/cover-front.pdf}
% Include extra pages in LaTeX
% Borrowed from https://github.com/jfogarty/latex-nonfiction-ebook-template/
\input{../../../extra-pages/title.tex}
\input{../../../extra-pages/quote.tex}
\input{../../../extra-pages/copyright.tex}
\input{../../../extra-pages/preface.tex}
''',
'preamble': r'''
% Make the code inside the paragraphs to be gray
\protected\def\sphinxcode#1{\textcolor{gray}{\texttt{#1}}}
\usepackage{pdfpages}
\usepackage{changepage}
\newif\ifsphinxverbatimwithminipage \sphinxverbatimwithminipagetrue
''',
'passoptionstopackages': r'\PassOptionsToPackage{gray}{xcolor}',
'fvset': r'''\fvset{fontsize=\footnotesize}''',
'printindex': r'''
\includepdf[pages=-]{../../../extra-pages/cover-back.pdf}
''',
}
latex_show_urls = 'footnote'
# Not sure if this is required or not
latex_docclass = {
'manual': 'book'
}
# Override appendices to remove license, about, etc
latex_appendices = [] # ['glossary']
# Use intersphinx to resolve links to content not included in the tutorial.
# See:
# https://github.com/PyAr/tutorial-en-papel/issues/18
# https://github.com/PyAr/tutorial-en-papel/issues/25#issuecomment-1311679864
#
# Doc: https://www.sphinx-doc.org/en/master/usage/quickstart.html#intersphinx
extensions.append('sphinx.ext.intersphinx')
intersphinx_mapping = {'python': ('https://docs.python.org/es/3', None)}