Message ID | 20160816091657.59926b39@vento.lan (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab <mchehab@s-opensource.com>: ... > The only issue there was the name of the math extension, with is also > sphinx.ext.pngmath. On a plus side, I was also able to remove one of the > hacks, by applying the enclosed patch (this doesn't work on 1.4 yet - > I suspect it requires some extra stuff to escape). > > So, for me, we're pretty much safe using xelatex, as it works fine for > Sphinx 1.3 and 1.4 (and, with Sphinx 1.2, provided that the user asks to > continue the build, just like what's needed with pdflatex on such > version). > > To make it generic, we'll need to patch conf.py to detect the Sphinx > version, and use the right math extension, depending on the version. > Also, as you proposed, Due to Sphinx version is 1.2, we'll need to use a > custom-made Makefile for tex. > > As xelatex support was added for version 1.5, we don't need to care > about it. I haven't checked on which version which math-extension was replaced. But it is easy to detect the sphinx version in conf.py. Add these lines to conf.py:: import sphinx major, minor, patch = map(int, sphinx.__version__.split(".")) The "minor" is what you are looking for. if minor > 3: extensions.append("sphinx.ext.imgmath") else: extensions.append("sphinx.ext.pngmath") -- Markus -- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Em Tue, 16 Aug 2016 14:35:16 +0200 Markus Heiser <markus.heiser@darmarit.de> escreveu: > Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab <mchehab@s-opensource.com>: > > ... > > The only issue there was the name of the math extension, with is also > > sphinx.ext.pngmath. On a plus side, I was also able to remove one of the > > hacks, by applying the enclosed patch (this doesn't work on 1.4 yet - > > I suspect it requires some extra stuff to escape). > > > > So, for me, we're pretty much safe using xelatex, as it works fine for > > Sphinx 1.3 and 1.4 (and, with Sphinx 1.2, provided that the user asks to > > continue the build, just like what's needed with pdflatex on such > > version). > > > > To make it generic, we'll need to patch conf.py to detect the Sphinx > > version, and use the right math extension, depending on the version. > > Also, as you proposed, Due to Sphinx version is 1.2, we'll need to use a > > custom-made Makefile for tex. > > > > As xelatex support was added for version 1.5, we don't need to care > > about it. > > I haven't checked on which version which math-extension was > replaced. But it is easy to detect the sphinx version in conf.py. > Add these lines to conf.py:: > > import sphinx > major, minor, patch = map(int, sphinx.__version__.split(".")) > > The "minor" is what you are looking for. > > if minor > 3: > extensions.append("sphinx.ext.imgmath") > else: > extensions.append("sphinx.ext.pngmath") Worked, thanks! Added on the patch series I submitted. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx index 8aa4fffda860..aa7ff32be589 100644 --- a/Documentation/Makefile.sphinx +++ b/Documentation/Makefile.sphinx @@ -49,7 +49,6 @@ ifeq ($(HAVE_PDFLATEX),0) @echo " SKIP Sphinx $@ target." else # HAVE_PDFLATEX $(call cmd,sphinx,latex) - (cd $(BUILDDIR); for i in *.rst; do echo >$$i; done) $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex endif # HAVE_PDFLATEX diff --git a/Documentation/conf.py b/Documentation/conf.py index 2bc91fcc6d1f..0a32d6b493e8 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -28,7 +28,7 @@ sys.path.insert(0, os.path.abspath('sphinx')) # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 'kernel_include'] +extensions = ['sphinx.ext.pngmath', 'kernel-doc', 'rstFlatTable', 'kernel_include'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl index 34bd9e2630b0..74089b0da798 100755 --- a/Documentation/sphinx/parse-headers.pl +++ b/Documentation/sphinx/parse-headers.pl @@ -220,7 +220,7 @@ $data =~ s/\n\s+\n/\n\n/g; # # Add escape codes for special characters # -$data =~ s,([\_\`\*\<\>\&\\\\:\/\|]),\\$1,g; +$data =~ s,([\_\`\*\<\>\&\\\\:\/\|\%\$\#\{\}\~\^]),\\$1,g; $data =~ s,DEPRECATED,**DEPRECATED**,g;