Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Em Tue, 16 Aug 2016 14:35:16 +0200 Markus Heiserescreveu: > Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab > : > > ... > > 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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Em Tue, 16 Aug 2016 13:48:13 +0200 Markus Heiserescreveu: > Am 16.08.2016 um 13:03 schrieb Mauro Carvalho Chehab > : > > > Em Tue, 16 Aug 2016 06:36:05 -0300 > > Mauro Carvalho Chehab escreveu: > > > > 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So, > > I had to manually replace it to xelatex. One easy solution would be to > > not use Make -C $BUILDDIR/latex, but to just call xelatex > > $BUILDDIR/$tex_name. > > I recommend to ship your own tex-Makefile, see: > > https://lkml.org/lkml/2016/8/10/114 That makes sense for me, but let the others review what we have so far. We can later improve and use a makefile for tex. I would prefer to call the version that will be copied to the output dir with a different name (like Makefile.tex or Makefile.in), as I found really weird to have a file called Makefile inside the Kernel tree that contains just a makefile prototype. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Am 16.08.2016 um 14:16 schrieb Mauro Carvalho Chehab: ... > 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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Em Tue, 16 Aug 2016 08:03:38 -0300 Mauro Carvalho Chehabescreveu: > Em Tue, 16 Aug 2016 06:36:05 -0300 > Mauro Carvalho Chehab escreveu: > Did some tests on Jessie. texlive required 219 packages there, 771MB. ... > There are 2 issues there that are easy to solve, but would require some > extra logic. I added a quick hack to make them build with xelatex. > See enclosed. The issues are: > > 1) the name of the math extension changed from sphinx.ext.pngmath to > sphinx.ext.imgmath on Sphinx 1.4. I guess it should be possible to add > some logic at conf.py to change the include depending on the Sphinx > version; > > 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So, > I had to manually replace it to xelatex. One easy solution would be to > not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name. ... > I'll try to install Ubuntu Xenial on a LXC container and repeat the test > there. Xenial seems to use Sphinx 1.3.6, according with: > http://packages.ubuntu.com/search?keywords=python-sphinx On Ubuntu Xenial LXC container, I had to install: texlive-xetex python3-sphinx python3-sphinx-rtd-theme ttf-dejavu make gcc python3-sphinx-rtd-theme With actually installed 259 packages, 1,6 GB after install (about 800MB of download). 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. Jon, What do you think? Let's move to xelatex? Thanks, Mauro 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 " SKIPSphinx $@ 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; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Am 16.08.2016 um 13:03 schrieb Mauro Carvalho Chehab: > Em Tue, 16 Aug 2016 06:36:05 -0300 > Mauro Carvalho Chehab escreveu: > > 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So, > I had to manually replace it to xelatex. One easy solution would be to > not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name. I recommend to ship your own tex-Makefile, see: https://lkml.org/lkml/2016/8/10/114 -- Markus To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Em Tue, 16 Aug 2016 06:36:05 -0300 Mauro Carvalho Chehabescreveu: > Em Tue, 16 Aug 2016 10:27:34 +0200 > Markus Heiser escreveu: > > > Am 15.08.2016 um 23:21 schrieb Mauro Carvalho Chehab > > : > > > > > pdflatex doesn't accept using some UTF-8 chars, like > > > "equal or less than" or "equal or greater than" chars. However, > > > the media documents use them. So, we need to use XeLaTeX for > > > conversion, and a font that accepts such characters. > > > > Right, we should use the XeLaTeX engine. But ... > > > > Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX. > > Yes, but official support for XeLaTeX was added for 1.5: > > https://github.com/agda/agda/commit/a6a437316c9b9d998e6d6d0a6a654a63422a4212 > > And the change there was really simple: it just adds it to the generated > Makefile. > > > E.g. in its defaults it uses "inputenc" and other stuff which > > is not a part of XeLaTeX. > > > > * https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426 > > > > This patch removes the "inputenc", thats right, but I think over > > short/long term we will see more errors related to LaTeX/XeLaTeX > > distinction. > > Actually, I don't expect troubles at long term, as it is now officially > supported. > > > And we will see that some conversion will break, depending > > on the sphinx version we use (There might be some non XeLateX friendly > > changes in the sphinx-versions, since it is not tested with XeLaTeX). > > Yeah, we need to double-check backward compatibility, and eventually > disable it on older versions. > > I can't easily test version 1.3.x anymore, as Fedora 24 upgraded to > Sphinx 1.4.4. The book builds fine on both 1.4.4 and 1.4.5. > > I'll install a Debian Jessie LXC container and double-check if the build > is fine with Sphinx version 1.2.x and check the package requirements. Did some tests on Jessie. texlive required 219 packages there, 771MB. The packages I installed there are: # 219 packages, 771MB - and includes some non-tex packages, that # are not present on the minimal LXC container install texlive-xetex # 24 packages, 7289kB python3-sphinx # 2 packages, 373kB python3-sphinx-rtd-theme # Build environment: 19 packages make gcc # Fonts ttf-dejavu There are 2 issues there that are easy to solve, but would require some extra logic. I added a quick hack to make them build with xelatex. See enclosed. The issues are: 1) the name of the math extension changed from sphinx.ext.pngmath to sphinx.ext.imgmath on Sphinx 1.4. I guess it should be possible to add some logic at conf.py to change the include depending on the Sphinx version; 2) the Latex auto-generated Makefile is hardcoded to use pdflatex. So, I had to manually replace it to xelatex. One easy solution would be to not use Make -C $BUILDDIR/latex, but to just call xelatex $BUILDDIR/$tex_name. Also, documentation hits an error. using or makes it build, but not sure what got missed there, as it has 1205 pages. I suspect that only the index was broken. The error happens during document output phase: [1] [2] (./TheLinuxKernel.toc) Adding blank page after the table of contents. [1] [2] [1] [2] Chapter 1. [3] [4] ! Misplaced \omit. \multispan ->\omit \@multispan l.407 \hline\end{tabulary} It resembles this error: https://www.mail-archive.com/sphinx-dev@googlegroups.com/msg06083.html So, I suspect it has nothing to do with xelatex, but it is, instead some Spinx 1.2.x bug when generating cell span output in Latex. It happened on this part of the LaTeX source code: \begin{threeparttable} \capstart\caption{table title} \begin{tabulary}{\linewidth}{|L|L|L|L|} \hline head col 1 & head col 2 & head col 3 & head col 4 \\ \hline column 1 & field 1.1 & \multicolumn{2}{l|}{ field 1.2 with autospan }\\ \hline column 2 & field 2.1 & \multirow{2}{*}{ \multicolumn{2}{l|}{ field 2.2 - 3.3 }}\\ \hline\phantomsection\label{kernel-documentation:last-row} column 3 & & \\ \hline\end{tabulary} \end{threeparttable} \end{quote} Btw, removing the media books and all latex options, using pdflatex still doesn't build cleanly on 1.2.x: Package inputenc Warning: inputenc package ignored with utf8 based engines. ) ! Undefined control sequence. \DeclareUnicodeCharacter l.5 \DeclareUnicodeCharacter {00A0}{\nobreakspace} Again, user has to use or to continue the build. I'll try to install Ubuntu Xenial on a LXC container and repeat the test there. Xenial seems to use Sphinx 1.3.6, according with: http://packages.ubuntu.com/search?keywords=python-sphinx Btw, as now both latest version of Ubuntu and Fedora uses Sphinx 1.4.x, perhaps we could raise the bar and just require Sphinx > 1.4. Thanks,
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Em Tue, 16 Aug 2016 10:27:34 +0200 Markus Heiserescreveu: > Am 15.08.2016 um 23:21 schrieb Mauro Carvalho Chehab > : > > > pdflatex doesn't accept using some UTF-8 chars, like > > "equal or less than" or "equal or greater than" chars. However, > > the media documents use them. So, we need to use XeLaTeX for > > conversion, and a font that accepts such characters. > > Right, we should use the XeLaTeX engine. But ... > > Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX. Yes, but official support for XeLaTeX was added for 1.5: https://github.com/agda/agda/commit/a6a437316c9b9d998e6d6d0a6a654a63422a4212 And the change there was really simple: it just adds it to the generated Makefile. > E.g. in its defaults it uses "inputenc" and other stuff which > is not a part of XeLaTeX. > > * https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426 > > This patch removes the "inputenc", thats right, but I think over > short/long term we will see more errors related to LaTeX/XeLaTeX > distinction. Actually, I don't expect troubles at long term, as it is now officially supported. > And we will see that some conversion will break, depending > on the sphinx version we use (There might be some non XeLateX friendly > changes in the sphinx-versions, since it is not tested with XeLaTeX). Yeah, we need to double-check backward compatibility, and eventually disable it on older versions. I can't easily test version 1.3.x anymore, as Fedora 24 upgraded to Sphinx 1.4.4. The book builds fine on both 1.4.4 and 1.4.5. I'll install a Debian Jessie LXC container and double-check if the build is fine with Sphinx version 1.2.x and check the package requirements. >Nevertheless, XeLaTeX is the right choice! > > My Suggestion is, that you merge this patch on top of Jon's doc-next. > There, we have the sub-folders feature, with we can test book by book > and improve our toolchain. > > -- Markus -- > > > > > > Signed-off-by: Mauro Carvalho Chehab > > --- > > Documentation/Makefile.sphinx | 6 +++--- > > Documentation/conf.py | 11 +++ > > 2 files changed, 14 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx > > index fc29e08085aa..aa7ff32be589 100644 > > --- a/Documentation/Makefile.sphinx > > +++ b/Documentation/Makefile.sphinx > > @@ -26,7 +26,7 @@ else ifneq ($(DOCBOOKS),) > > else # HAVE_SPHINX > > > > # User-friendly check for pdflatex > > -HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; > > else echo 0; fi) > > +HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; > > else echo 0; fi) > > > > # Internal variables. > > PAPEROPT_a4 = -D latex_paper_size=a4 > > @@ -45,11 +45,11 @@ htmldocs: > > > > pdfdocs: > > ifeq ($(HAVE_PDFLATEX),0) > > - $(warning The 'pdflatex' command was not found. Make sure you have it > > installed and in PATH to produce PDF output.) > > + $(warning The 'xelatex' command was not found. Make sure you have it > > installed and in PATH to produce PDF output.) > > @echo " SKIPSphinx $@ target." > > else # HAVE_PDFLATEX > > $(call cmd,sphinx,latex) > > - $(Q)$(MAKE) -C $(BUILDDIR)/latex > > + $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex > > endif # HAVE_PDFLATEX > > > > epubdocs: > > diff --git a/Documentation/conf.py b/Documentation/conf.py > > index bbf2878d9945..f4469cd0340d 100644 > > --- a/Documentation/conf.py > > +++ b/Documentation/conf.py > > @@ -260,6 +260,10 @@ latex_elements = { > > # Latex figure (float) alignment > > #'figure_align': 'htbp', > > > > +# Don't mangle with UTF-8 chars > > +'inputenc': '', > > +'utf8extra': '', > > + > > # Additional stuff for the LaTeX preamble. > > 'preamble': ''' > > % Allow generate some pages in landscape > > @@ -287,6 +291,13 @@ latex_elements = { > > \\end{graybox} > > } > > \\makeatother > > + > > + % Use some font with UTF-8 support with XeLaTeX > > +\\usepackage{fontspec} > > +\\setsansfont{DejaVu Serif} > > +\\setromanfont{DejaVu Sans} > > +\\setmonofont{DejaVu Sans Mono} > > + > > ''' > > } > > > > -- > > 2.7.4 > > > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-media" in > > the body of a message to majord...@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > Thanks, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Am 15.08.2016 um 23:21 schrieb Mauro Carvalho Chehab: > pdflatex doesn't accept using some UTF-8 chars, like > "equal or less than" or "equal or greater than" chars. However, > the media documents use them. So, we need to use XeLaTeX for > conversion, and a font that accepts such characters. Right, we should use the XeLaTeX engine. But ... Sphinx LaTeX output was/is developed for LaTeX, not for XeLaTeX. E.g. in its defaults it uses "inputenc" and other stuff which is not a part of XeLaTeX. * https://github.com/sphinx-doc/sphinx/issues/894#issuecomment-220786426 This patch removes the "inputenc", thats right, but I think over short/long term we will see more errors related to LaTeX/XeLaTeX distinction. And we will see that some conversion will break, depending on the sphinx version we use (There might be some non XeLateX friendly changes in the sphinx-versions, since it is not tested with XeLaTeX). Nevertheless, XeLaTeX is the right choice! My Suggestion is, that you merge this patch on top of Jon's doc-next. There, we have the sub-folders feature, with we can test book by book and improve our toolchain. -- Markus -- > > Signed-off-by: Mauro Carvalho Chehab > --- > Documentation/Makefile.sphinx | 6 +++--- > Documentation/conf.py | 11 +++ > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx > index fc29e08085aa..aa7ff32be589 100644 > --- a/Documentation/Makefile.sphinx > +++ b/Documentation/Makefile.sphinx > @@ -26,7 +26,7 @@ else ifneq ($(DOCBOOKS),) > else # HAVE_SPHINX > > # User-friendly check for pdflatex > -HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; > else echo 0; fi) > +HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else > echo 0; fi) > > # Internal variables. > PAPEROPT_a4 = -D latex_paper_size=a4 > @@ -45,11 +45,11 @@ htmldocs: > > pdfdocs: > ifeq ($(HAVE_PDFLATEX),0) > - $(warning The 'pdflatex' command was not found. Make sure you have it > installed and in PATH to produce PDF output.) > + $(warning The 'xelatex' command was not found. Make sure you have it > installed and in PATH to produce PDF output.) > @echo " SKIPSphinx $@ target." > else # HAVE_PDFLATEX > $(call cmd,sphinx,latex) > - $(Q)$(MAKE) -C $(BUILDDIR)/latex > + $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex > endif # HAVE_PDFLATEX > > epubdocs: > diff --git a/Documentation/conf.py b/Documentation/conf.py > index bbf2878d9945..f4469cd0340d 100644 > --- a/Documentation/conf.py > +++ b/Documentation/conf.py > @@ -260,6 +260,10 @@ latex_elements = { > # Latex figure (float) alignment > #'figure_align': 'htbp', > > +# Don't mangle with UTF-8 chars > +'inputenc': '', > +'utf8extra': '', > + > # Additional stuff for the LaTeX preamble. > 'preamble': ''' > % Allow generate some pages in landscape > @@ -287,6 +291,13 @@ latex_elements = { > \\end{graybox} > } > \\makeatother > + > + % Use some font with UTF-8 support with XeLaTeX > +\\usepackage{fontspec} > +\\setsansfont{DejaVu Serif} > +\\setromanfont{DejaVu Sans} > +\\setmonofont{DejaVu Sans Mono} > + > ''' > } > > -- > 2.7.4 > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
pdflatex doesn't accept using some UTF-8 chars, like "equal or less than" or "equal or greater than" chars. However, the media documents use them. So, we need to use XeLaTeX for conversion, and a font that accepts such characters. Signed-off-by: Mauro Carvalho Chehab--- Documentation/Makefile.sphinx | 6 +++--- Documentation/conf.py | 11 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx index fc29e08085aa..aa7ff32be589 100644 --- a/Documentation/Makefile.sphinx +++ b/Documentation/Makefile.sphinx @@ -26,7 +26,7 @@ else ifneq ($(DOCBOOKS),) else # HAVE_SPHINX # User-friendly check for pdflatex -HAVE_PDFLATEX := $(shell if which pdflatex >/dev/null 2>&1; then echo 1; else echo 0; fi) +HAVE_PDFLATEX := $(shell if which xelatex >/dev/null 2>&1; then echo 1; else echo 0; fi) # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 @@ -45,11 +45,11 @@ htmldocs: pdfdocs: ifeq ($(HAVE_PDFLATEX),0) - $(warning The 'pdflatex' command was not found. Make sure you have it installed and in PATH to produce PDF output.) + $(warning The 'xelatex' command was not found. Make sure you have it installed and in PATH to produce PDF output.) @echo " SKIPSphinx $@ target." else # HAVE_PDFLATEX $(call cmd,sphinx,latex) - $(Q)$(MAKE) -C $(BUILDDIR)/latex + $(Q)$(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex endif # HAVE_PDFLATEX epubdocs: diff --git a/Documentation/conf.py b/Documentation/conf.py index bbf2878d9945..f4469cd0340d 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -260,6 +260,10 @@ latex_elements = { # Latex figure (float) alignment #'figure_align': 'htbp', +# Don't mangle with UTF-8 chars +'inputenc': '', +'utf8extra': '', + # Additional stuff for the LaTeX preamble. 'preamble': ''' % Allow generate some pages in landscape @@ -287,6 +291,13 @@ latex_elements = { \\end{graybox} } \\makeatother + + % Use some font with UTF-8 support with XeLaTeX +\\usepackage{fontspec} +\\setsansfont{DejaVu Serif} +\\setromanfont{DejaVu Sans} +\\setmonofont{DejaVu Sans Mono} + ''' } -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html