summaryrefslogtreecommitdiff
path: root/Documentation/conf.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-08-18 17:22:10 -0600
committerJonathan Corbet <corbet@lwn.net>2016-08-18 17:22:10 -0600
commit5dc6911f16107f7fb3f87369c2eadcb2bee6449a (patch)
treea4c315f24fbc5fc4d79de567c07083dfbb1068dd /Documentation/conf.py
parentcc935bb5969ae16502a940809b4962e948a7aa9c (diff)
parent44f4ddd1bff04196349ab229a6a08e5223fe1594 (diff)
Merge branch 'doc/4.9' into docs-next
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r--Documentation/conf.py66
1 files changed, 55 insertions, 11 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 5c06b018ad1d..39b9c4a26f6e 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -14,6 +14,11 @@
import sys
import os
+import sphinx
+
+# Get Sphinx version
+major, minor, patch = map(int, sphinx.__version__.split("."))
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -31,12 +36,11 @@ from load_config import loadConfig
# ones.
extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
-# Gracefully handle missing rst2pdf.
-try:
- import rst2pdf
- extensions += ['rst2pdf.pdfbuilder']
-except ImportError:
- pass
+# The name of the math extension changed on Sphinx 1.4
+if minor > 3:
+ extensions.append("sphinx.ext.imgmath")
+else:
+ extensions.append("sphinx.ext.pngmath")
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -253,16 +257,56 @@ htmlhelp_basename = 'TheLinuxKerneldoc'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+'pointsize': '8pt',
# Latex figure (float) alignment
#'figure_align': 'htbp',
+
+# Don't mangle with UTF-8 chars
+'inputenc': '',
+'utf8extra': '',
+
+# Additional stuff for the LaTeX preamble.
+ 'preamble': '''
+ % Adjust margins
+ \\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}
+
+ % Allow generate some pages in landscape
+ \\usepackage{lscape}
+
+ % Put notes in gray color and let them be inside a table
+
+ \\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
+
+ \\makeatletter\\newenvironment{graybox}{%
+ \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}%
+ \\colorbox{MyGray}{\\usebox{\\@tempboxa}}
+ }\\makeatother
+
+ \\makeatletter
+ \\renewenvironment{notice}[2]{
+ \\begin{graybox}
+ \\bf\\it
+ \\def\\py@noticetype{#1}
+ \\par\\strong{#2}
+ \\csname py@noticestart@#1\\endcsname
+ }
+ {
+ \\csname py@noticeend@\\py@noticetype\\endcsname
+ \\end{graybox}
+ }
+ \\makeatother
+
+ % Use some font with UTF-8 support with XeLaTeX
+ \\usepackage{fontspec}
+ \\setsansfont{DejaVu Serif}
+ \\setromanfont{DejaVu Sans}
+ \\setmonofont{DejaVu Sans Mono}
+
+ '''
}
# Grouping the document tree into LaTeX files. List of tuples