public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	linux-doc@vger.kernel.org,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Markus Heiser <markus.heiser@darmarit.de>
Subject: Re: [RFC PATCH 0/3] Documentation: switch to pdflatex and fix pdf build
Date: Mon, 15 Aug 2016 09:17:52 -0300	[thread overview]
Message-ID: <20160815091752.747d25e4@vento.lan> (raw)
In-Reply-To: <87lgzyv08q.fsf@intel.com>

Em Mon, 15 Aug 2016 12:40:21 +0300
Jani Nikula <jani.nikula@intel.com> escreveu:

> On Sat, 13 Aug 2016, Jonathan Corbet <corbet@lwn.net> wrote:
> > On Wed, 10 Aug 2016 18:54:06 +0300
> > Jani Nikula <jani.nikula@intel.com> wrote:
> >  
> >> With these you should be able to get started with pdf generation. It's a
> >> quick transition to pdflatex, the patches are not very pretty, but the
> >> pdf output is. Patch 3/3 works as an example where to add your stuff
> >> (latex_documents in conf.py) and how.  
> >
> > OK, now I have a bone to pick with you.
> >
> > I applied this, then decided to install the needed toolchain on the
> > Tumbleweed system I've been playing with; it wanted to install 1,727
> > packages to get pdflatex.  Pandoc just doesn't seem so bad anymore.  
> 
> Jon, I sent these to unblock Luis, and as a starting point for a
> discussion about rst2pdf vs. pdflatex. I didn't mean I'd want these
> merged as-is! I'm sorry if I didn't make myself clear.
> 
> I don't mind at all if you want to drop them.
> 
> As I played around, it worked for *me* better than rst2pdf. I had
> pdflatex already installed, so I didn't pay attention to the deps, and
> the numbers you quote come as a suprise.
> 
> > I've applied this so we have something to play with, but it doesn't feel
> > like a great solution.  This is the sort of installation hell that we
> > wanted to get away from.  It makes me wonder how hard it can really be to
> > fix rst2pdf; I wish I could say I'll find some time to figure that out.
> > Sigh.  
> 
> I'm afraid pdf generation is not very high on my list of priorities
> right now. Surely I'll get back to this eventually, but not any time
> soon. :(

I'm afraid that, no matter if we'll be using rst2pdf or pdflatex,
we'll need LaTex anyway.

One of the things that we want on media is to better represent the
math formulas there. Just enabling the math extension is enough for
it to require not only LaTex, but also this package (on Fedora):
	texlive-anyfontsize.noarch

So, unfortunately, I'm afraid that we'll end by having a much worse
dependency chain than what we used to have with DocBook.

An (incomplete) patch to let you test it is enclosed (it is actually after
patches 1 and 2 of this series).

Ah, it seems that rst2pdf is not compatible with math extension...

If we change the conf.py to:
	extensions = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 'kernel_include']

	# Gracefully handle missing rst2pdf.
	try:
	    import rst2pdf
	    extensions += ['rst2pdf.pdfbuilder']
	except ImportError:
	    pass

The logic that tries to import rst2pdf produces the following error:

	Extension error:
	Config value 'math_number_all' already present

And, if we don't add the imgmath extension, the math expression
appears broken at the generated html page:

	The transfer function defined for SMPTE 170M is the same as the one defined in Rec. 709.
	L' = -1.099(-L)^{0.45} + 0.099 \text{ for } L \le-0.018 L' = 4.5L \text{ for } -0.018 < L < 0.018 L' = 1.099L^{0.45} - 0.099 \text{ for } L \ge 0.018

Btw, changing to math is a requirement for pdflatex to work on media,
as the font used by Sphinx/pdflatex doesn't have UTF-8 symbols used
on math. So, trying to build the documentation with pdfdocs (after
patches 1 and 2, before patch 3) would give fatal errors like:

	! Package inputenc Error: Unicode char \u8:≥ not set up for use with LaTeX.

	See the inputenc package documentation for explanation.
	Type  H <return>  for immediate help.
	 ...                                              
                                                  
	l.7759 ....099L $^{\text{0.45}}$ - 0.099 for L ≥
							 0.018

The problem is that the "grater or equal than" UTF-8 Math symbol
is not supported on the LaTex font.


Thanks,
Mauro


diff --git a/Documentation/conf.py b/Documentation/conf.py
index 96b7aa66c89c..0b60a55cea89 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -28,14 +28,14 @@ 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 = ['kernel-doc', 'rstFlatTable', 'kernel_include']
+extensions = ['sphinx.ext.imgmath', 'kernel-doc', 'rstFlatTable', 'kernel_include']
 
 # Gracefully handle missing rst2pdf.
-try:
-    import rst2pdf
-    extensions += ['rst2pdf.pdfbuilder']
-except ImportError:
-    pass
+#try:
+#    import rst2pdf
+#    extensions += ['rst2pdf.pdfbuilder']
+#except ImportError:
+#    pass
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 8c946b0c63a0..1253c3283b10 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -72,11 +72,13 @@ SMPTE C set, so this colorspace is sometimes called SMPTE C as well.
 The transfer function defined for SMPTE 170M is the same as the one
 defined in Rec. 709.
 
-    L' = -1.099(-L) :sup:`0.45` + 0.099 for L ≤ -0.018
+.. math::
 
-    L' = 4.5L for -0.018 < L < 0.018
+    L' = -1.099(-L)^{0.45} + 0.099 \text{ for } L \le-0.018
 
-    L' = 1.099L :sup:`0.45` - 0.099 for L ≥ 0.018
+    L' = 4.5L \text{ for } -0.018 < L < 0.018
+
+    L' = 1.099L^{0.45} - 0.099 \text{ for } L \ge 0.018
 
 Inverse Transfer function:
 

  reply	other threads:[~2016-08-15 12:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10  1:19 Making pdfdocs with sphinx - only select rst targets Luis R. Rodriguez
2016-08-10  8:41 ` Mauro Carvalho Chehab
     [not found]   ` <CAB=NE6UUiKSn66=F+WUrqk3E1tj+fnzqFnD=dX55md6RnaiOgQ@mail.gmail.com>
2016-08-10 15:05     ` Mauro Carvalho Chehab
2016-08-10 15:54       ` [RFC PATCH 0/3] Documentation: switch to pdflatex and fix pdf build Jani Nikula
2016-08-10 15:54         ` [RFC PATCH 1/3] Documentation/sphinx: build the media intermediate rst files for all outputs Jani Nikula
2016-08-10 16:14           ` Mauro Carvalho Chehab
2016-08-10 15:54         ` [RFC PATCH 2/3] Documentation: switch to pdflatex for pdf generation Jani Nikula
2016-08-10 17:15           ` Markus Heiser
2016-08-10 20:07           ` Luis R. Rodriguez
2016-08-10 15:54         ` [RFC PATCH 3/3] Documentation: exclude media documentation from " Jani Nikula
2016-08-10 16:16           ` Mauro Carvalho Chehab
2016-08-10 16:31             ` Markus Heiser
2016-08-10 20:05           ` Luis R. Rodriguez
2016-08-10 16:27         ` [RFC PATCH 0/3] Documentation: switch to pdflatex and fix pdf build Markus Heiser
2016-08-10 20:09         ` Luis R. Rodriguez
2016-08-12 22:40         ` Jonathan Corbet
2016-08-13 16:00           ` Markus Heiser
2016-08-15  9:40           ` Jani Nikula
2016-08-15 12:17             ` Mauro Carvalho Chehab [this message]
2016-08-15 22:26               ` Mauro Carvalho Chehab
2016-08-19 12:54                 ` Jani Nikula
2016-08-19 13:21                   ` 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=20160815091752.747d25e4@vento.lan \
    --to=mchehab@infradead.org \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=jani.nikula@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.heiser@darmarit.de \
    --cc=mcgrof@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