]> git.karo-electronics.de Git - linux-beck.git/commitdiff
docs-rst: fix LaTeX \DURole renewcommand with Sphinx 1.3+
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 14 Nov 2016 16:32:27 +0000 (14:32 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:32 +0000 (11:39 +0100)
commit e2a91f4f42018994d7424d405900d17eba6555d0 upstream.

PDF build on Kernel 4.9-rc? returns an error with Sphinx 1.3.x
and Sphinx 1.4.x, when trying to solve some cross-references.

The solution is to redefine the \DURole macro.

However, this is redefined too late. Move such redefinition to
LaTeX preamble and bind it to just the Sphinx versions where the
error is known to be present.

Tested by building the documentation on interactive mode:
make PDFLATEX=xelatex -C Documentation/output/./latex

Fixes: e61a39baf74d ("[media] index.rst: Fix LaTeX error in interactive mode on Sphinx 1.4.x")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/conf.py
Documentation/media/index.rst

index bf6f310e51705300e8f060c39125463b40d45873..d769cd89a9f7d8ba24e09bd4a03eec3910ccb796 100644 (file)
@@ -37,7 +37,7 @@ from load_config import loadConfig
 extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain']
 
 # The name of the math extension changed on Sphinx 1.4
-if minor > 3:
+if major == 1 and minor > 3:
     extensions.append("sphinx.ext.imgmath")
 else:
     extensions.append("sphinx.ext.pngmath")
@@ -332,6 +332,10 @@ latex_elements = {
      '''
 }
 
+# Fix reference escape troubles with Sphinx 1.4.x
+if major == 1 and minor > 3:
+    latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
+
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
index e347a3e7bdef4e5db38ec75fdacbf024d04378e4..7f8f0af620ceb281416462b88e332491ddbdaa98 100644 (file)
@@ -1,11 +1,6 @@
 Linux Media Subsystem Documentation
 ===================================
 
-.. Sphinx 1.4.x has a definition for DUrole that doesn't work on alltt blocks
-.. raw:: latex
-
-       \renewcommand*{\DUrole}[2]{ #2 }
-
 Contents:
 
 .. toctree::