public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output
Date: Tue, 16 Aug 2016 06:36:05 -0300	[thread overview]
Message-ID: <20160816063605.6ef0ed27@vento.lan> (raw)
In-Reply-To: <4483E8C4-BBAC-4866-881D-3FBA5B85E834@darmarit.de>

Em Tue, 16 Aug 2016 10:27:34 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> Am 15.08.2016 um 23:21 schrieb Mauro Carvalho Chehab <mchehab@s-opensource.com>:
> 
> > 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 <mchehab@s-opensource.com>
> > ---
> > 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 "  SKIP    Sphinx $@ 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 majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html  
> 



Thanks,
Mauro

  reply	other threads:[~2016-08-16  9:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 21:21 [PATCH RFC v2 0/9] Make PDF output for media book to work Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH 1/9] docs-rst: allow generating some LaTeX pages in landscape Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 2/9] docs-rst: improve output for .. notes:: on LaTeX Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 3/9] docs-rst: Don't mangle with UTF-8 chars on LaTeX/PDF output Mauro Carvalho Chehab
2016-08-16  8:27   ` Markus Heiser
2016-08-16  9:36     ` Mauro Carvalho Chehab [this message]
2016-08-16 11:03       ` Mauro Carvalho Chehab
2016-08-16 11:48         ` Markus Heiser
2016-08-16 16:51           ` Mauro Carvalho Chehab
2016-08-16 12:16         ` Mauro Carvalho Chehab
2016-08-16 12:35           ` Markus Heiser
2016-08-16 16:52             ` Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 4/9] [media] pixfmt-007.rst: use Sphinx math:: expressions Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 5/9] [media] pixfmt-nv12mt.rst: use PNG instead of GIF Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 6/9] [media] vidioc-enumstd.rst: fix a broken reference Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 7/9] [media] vidioc-enumstd.rst: remove bullets from sound carrier Mauro Carvalho Chehab
2016-08-15 21:21 ` [PATCH RFC v2 8/9] [media] docs-rst: better use the .. note:: tag Mauro Carvalho Chehab
2016-08-15 21:22 ` [PATCH RFC v2 9/9] HACK: make pdfdocs build with media books 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=20160816063605.6ef0ed27@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=markus.heiser@darmarit.de \
    --cc=mchehab@infradead.org \
    /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