Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513552 > unrolled thread

[PATCH RFC 1/4] docs-rst: fix PDF build errors

Started byMauro Carvalho Chehab <mchehab@osg.samsung.com>
First post2016-11-01 23:50 +0100
Last post2016-11-02 16:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH RFC 1/4] docs-rst: fix PDF build errors Mauro Carvalho Chehab <mchehab@osg.samsung.com> - 2016-11-01 23:50 +0100
    Re: [PATCH RFC 1/4] docs-rst: fix PDF build errors Markus Heiser <markus.heiser@darmarit.de> - 2016-11-02 16:10 +0100
    Re: [PATCH RFC 1/4] docs-rst: fix PDF build errors Markus Heiser <markus.heiser@darmarit.de> - 2016-11-02 16:10 +0100

#1513552 — [PATCH RFC 1/4] docs-rst: fix PDF build errors

FromMauro Carvalho Chehab <mchehab@osg.samsung.com>
Date2016-11-01 23:50 +0100
Subject[PATCH RFC 1/4] docs-rst: fix PDF build errors
Message-ID<syQ2t-6iF-7@gated-at.bofh.it>
PDF build on Kernel 4.9-rc? returns an error. This is
because we're re-defining a command too late. Move
such redefinition to LaTeX preamble.

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@osg.samsung.com>
---
 Documentation/conf.py         | 4 ++++
 Documentation/media/index.rst | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index d9bad21dd427..814c336e5f5e 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -332,6 +332,10 @@ latex_elements = {
      '''
 }
 
+# Fix reference escape troubles with Sphinx 1.4.x
+if minor > 3:
+    latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }'
+
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst
index e347a3e7bdef..7f8f0af620ce 100644
--- a/Documentation/media/index.rst
+++ b/Documentation/media/index.rst
@@ -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::
-- 
2.7.4

[toc] | [next] | [standalone]


#1513908

FromMarkus Heiser <markus.heiser@darmarit.de>
Date2016-11-02 16:10 +0100
Message-ID<sz5kS-7UD-33@gated-at.bofh.it>
In reply to#1513552
Am 01.11.2016 um 23:44 schrieb Mauro Carvalho Chehab <mchehab@osg.samsung.com>:

> PDF build on Kernel 4.9-rc? returns an error. This is
> because we're re-defining a command too late. Move
> such redefinition to LaTeX preamble.
> 
> 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@osg.samsung.com>
> ---
> Documentation/conf.py         | 4 ++++
> Documentation/media/index.rst | 5 -----
> 2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index d9bad21dd427..814c336e5f5e 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -332,6 +332,10 @@ latex_elements = {
>     '''
> }
> 
> +# Fix reference escape troubles with Sphinx 1.4.x
> +if minor > 3:
> +    latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }'

Sorry forget to mention: when adding content to the preamble I recommend
to add a leading and trailing new-line.

-- Markus --

[toc] | [prev] | [next] | [standalone]


#1513909

FromMarkus Heiser <markus.heiser@darmarit.de>
Date2016-11-02 16:10 +0100
Message-ID<sz5kS-7UD-31@gated-at.bofh.it>
In reply to#1513552
Am 01.11.2016 um 23:44 schrieb Mauro Carvalho Chehab <mchehab@osg.samsung.com>:

> PDF build on Kernel 4.9-rc? returns an error. This is
> because we're re-defining a command too late. Move
> such redefinition to LaTeX preamble.
> 
> 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@osg.samsung.com>
> ---
> Documentation/conf.py         | 4 ++++
> Documentation/media/index.rst | 5 -----
> 2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/conf.py b/Documentation/conf.py
> index d9bad21dd427..814c336e5f5e 100644
> --- a/Documentation/conf.py
> +++ b/Documentation/conf.py
> @@ -332,6 +332,10 @@ latex_elements = {
>      '''
> }
> 
> +# Fix reference escape troubles with Sphinx 1.4.x
> +if minor > 3:
> +    latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }'

For Sphinx's version detection we should also include the
major version number e.g::

  if major == 1 and minor > 3:

BTW: can you also fix ...

 # The name of the math extension changed on Sphinx 1.4
-if minor > 3:
-    extensions.append("sphinx.ext.imgmath")
-else:
+if major == 1 and minor < 4:
     extensions.append("sphinx.ext.pngmath")
+else:
+    extensions.append("sphinx.ext.imgmath")
 
-- Markus --


> +
> # Grouping the document tree into LaTeX files. List of tuples
> # (source start file, target name, title,
> #  author, documentclass [howto, manual, or own class]).
> diff --git a/Documentation/media/index.rst b/Documentation/media/index.rst
> index e347a3e7bdef..7f8f0af620ce 100644
> --- a/Documentation/media/index.rst
> +++ b/Documentation/media/index.rst
> @@ -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::
> -- 
> 2.7.4
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web