aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/conf.py62
1 files changed, 43 insertions, 19 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 38a606b07285..b986eda20a05 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -271,6 +271,31 @@ latex_elements = {
271 271
272# Additional stuff for the LaTeX preamble. 272# Additional stuff for the LaTeX preamble.
273 'preamble': ''' 273 'preamble': '''
274 % Use some font with UTF-8 support with XeLaTeX
275 \\usepackage{fontspec}
276 \\setsansfont{DejaVu Serif}
277 \\setromanfont{DejaVu Sans}
278 \\setmonofont{DejaVu Sans Mono}
279
280 % To allow adjusting table sizes
281 \\usepackage{adjustbox}
282
283 '''
284}
285
286# Fix reference escape troubles with Sphinx 1.4.x
287if major == 1 and minor > 3:
288 latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
289
290if major == 1 and minor <= 4:
291 latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
292elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
293 latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
294 latex_elements['preamble'] += '\\fvset{fontsize=auto}\n'
295
296# Customize notice background colors on Sphinx < 1.6:
297if major == 1 and minor < 6:
298 latex_elements['preamble'] += '''
274 \\usepackage{ifthen} 299 \\usepackage{ifthen}
275 300
276 % Put notes in color and let them be inside a table 301 % Put notes in color and let them be inside a table
@@ -322,27 +347,26 @@ latex_elements = {
322 } 347 }
323 \\makeatother 348 \\makeatother
324 349
325 % Use some font with UTF-8 support with XeLaTeX
326 \\usepackage{fontspec}
327 \\setsansfont{DejaVu Serif}
328 \\setromanfont{DejaVu Sans}
329 \\setmonofont{DejaVu Sans Mono}
330
331 % To allow adjusting table sizes
332 \\usepackage{adjustbox}
333
334 ''' 350 '''
335}
336
337# Fix reference escape troubles with Sphinx 1.4.x
338if major == 1 and minor > 3:
339 latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
340 351
341if major == 1 and minor <= 4: 352# With Sphinx 1.6, it is possible to change the Bg color directly
342 latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}' 353# by using:
343elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)): 354# \definecolor{sphinxnoteBgColor}{RGB}{204,255,255}
344 latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in' 355# \definecolor{sphinxwarningBgColor}{RGB}{255,204,204}
345 latex_elements['preamble'] += '\\fvset{fontsize=auto}\n' 356# \definecolor{sphinxattentionBgColor}{RGB}{255,255,204}
357# \definecolor{sphinximportantBgColor}{RGB}{192,255,204}
358#
359# However, it require to use sphinx heavy box with:
360#
361# \renewenvironment{sphinxlightbox} {%
362# \\begin{sphinxheavybox}
363# }
364# \\end{sphinxheavybox}
365# }
366#
367# Unfortunately, the implementation is buggy: if a note is inside a
368# table, it isn't displayed well. So, for now, let's use boring
369# black and white notes.
346 370
347# Grouping the document tree into LaTeX files. List of tuples 371# Grouping the document tree into LaTeX files. List of tuples
348# (source start file, target name, title, 372# (source start file, target name, title,