linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>
Subject: [PATCH v2 1/6] docs-rst: fix LaTeX \DURole renewcommand with Sphinx 1.3+
Date: Mon,  7 Nov 2016 13:20:39 -0200	[thread overview]
Message-ID: <e976bfb8ce0efb8c47118d05c394a25bcec9bb7f.1478531459.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1478531459.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1478531459.git.mchehab@s-opensource.com>

From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

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@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/conf.py         | 6 +++++-
 Documentation/media/index.rst | 5 -----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index d9bad21dd427..557f6b936ffd 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -37,7 +37,7 @@ from load_config import loadConfig
 extensions = ['kerneldoc', '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]).
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

  reply	other threads:[~2016-11-07 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 15:20 [PATCH v2 0/6] Fix PDF builds on media documentation Mauro Carvalho Chehab
2016-11-07 15:20 ` Mauro Carvalho Chehab [this message]
2016-11-07 15:20 ` [PATCH v2 2/6] [media] subdev-formats.rst: don't use adjustbox on a longtable Mauro Carvalho Chehab
2016-11-07 15:20 ` [PATCH v2 3/6] [media] subdev-formats.rst: add missing columns to tabularcolumns Mauro Carvalho Chehab
2016-11-07 15:20 ` [PATCH v2 4/6] [media] convert some images from png to svg Mauro Carvalho Chehab
2016-11-07 15:20 ` [PATCH v2 5/6] [media] docs-rst: convert gif files to png Mauro Carvalho Chehab
2016-11-07 15:20 ` [PATCH v2 6/6] [media] docs-rst: auto-generate PDF image files Mauro Carvalho Chehab
2016-11-08  9:04 ` [PATCH v2 0/6] Fix PDF builds on media documentation Jani Nikula
2016-11-08  9:04   ` Jani Nikula
2016-11-08  9:19     ` Mauro Carvalho Chehab
2016-11-08  9:56       ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e976bfb8ce0efb8c47118d05c394a25bcec9bb7f.1478531459.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).