From patchwork Tue Aug 16 12:16:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9283761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84A4D600CB for ; Tue, 16 Aug 2016 12:17:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 748DF2861F for ; Tue, 16 Aug 2016 12:17:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 695DC28627; Tue, 16 Aug 2016 12:17:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 300912861F for ; Tue, 16 Aug 2016 12:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753244AbcHPMRj (ORCPT ); Tue, 16 Aug 2016 08:17:39 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:57446 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbcHPMRi (ORCPT ); Tue, 16 Aug 2016 08:17:38 -0400 Received: from localhost (localhost [127.0.0.1]) by s-opensource.com (Postfix) with ESMTP id C218BA0E78; Tue, 16 Aug 2016 12:17:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from s-opensource.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qo8D7qh56BAJ; Tue, 16 Aug 2016 12:17:04 +0000 (UTC) Received: from vento.lan (177.96.205.192.dynamic.adsl.gvt.net.br [177.96.205.192]) by s-opensource.com (Postfix) with ESMTPSA id 1B2A0A0E61; Tue, 16 Aug 2016 12:17:02 +0000 (UTC) Date: Tue, 16 Aug 2016 09:16:57 -0300 From: Mauro Carvalho Chehab To: Markus Heiser , Jonathan Corbet Cc: Linux Media Mailing List , Mauro Carvalho Chehab , 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 Message-ID: <20160816091657.59926b39@vento.lan> In-Reply-To: <20160816080338.56c6e5d1@vento.lan> References: <5ceebc273ff089c275c753c78f6e6c6e732b4077.1471294965.git.mchehab@s-opensource.com> <4483E8C4-BBAC-4866-881D-3FBA5B85E834@darmarit.de> <20160816063605.6ef0ed27@vento.lan> <20160816080338.56c6e5d1@vento.lan> Organization: Samsung X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Em Tue, 16 Aug 2016 08:03:38 -0300 Mauro Carvalho Chehab escreveu: > 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 --- 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;