From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11754 Path: news.gmane.org!not-for-mail From: Beni Cherniavsky-Paskin Newsgroups: gmane.text.pandoc Subject: Re: Maths in ebooks Date: Fri, 16 Jan 2015 02:55:54 +0200 Message-ID: References: <20150115203001.GA10846@protagoras.berkeley.edu> <20150115203204.GB2131@jhs-think> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04448067800dfd050cba70a0 X-Trace: ger.gmane.org 1421369781 25780 80.91.229.3 (16 Jan 2015 00:56:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 00:56:21 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCXKJ7VLTEEBBL6D4GSQKGQE2AU5IXA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 16 01:56:17 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-we0-f192.google.com ([74.125.82.192]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBvCy-0001YF-Et for gtp-pandoc-discuss@m.gmane.org; Fri, 16 Jan 2015 01:56:16 +0100 Original-Received: by mail-we0-f192.google.com with SMTP id w62sf1504976wes.9 for ; Thu, 15 Jan 2015 16:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=SIPlP3T4XAuJT7zKEfh/yP8DvSRP4s2Dk5YItYdzROA=; b=HBXHYd9+r9LFmqMoyZqd2GYZSNZwWCgt39KcyIhvn1DM2Z+ix6oyWHLlb9FwXTSJ3B WkPOpHBO+XZCYSq4crcqBEaY1pP1weNUWQ1wNnk0rq1e1fecU9yfQXdE2LfquLcwKKsj ymTnTND84M2DBsZuyh4/1TyqnQPfKz3hJ0RnGZfNfSxKzoafQj9Tk/OT3pjSWyne8fQJ MR5Su6wiiUqmGHnIlHbGNkGRuNKuBh4o6lfv8F80O9a35XCoUO+5pkBrqB9QUbkMLTZZ Rd9a0Mvdq0HeGnGjG+UQQtRBqFcLB02TmZ118yc5FhJFCu58sYxhY4fiITEZPKnw87d7 iqpA== X-Received: by 10.152.27.170 with SMTP id u10mr57153lag.7.1421369775921; Thu, 15 Jan 2015 16:56:15 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.152.3.170 with SMTP id d10ls265168lad.37.gmail; Thu, 15 Jan 2015 16:56:14 -0800 (PST) X-Received: by 10.152.181.138 with SMTP id dw10mr827205lac.1.1421369774653; Thu, 15 Jan 2015 16:56:14 -0800 (PST) Original-Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com. [2a00:1450:400c:c05::22e]) by gmr-mx.google.com with ESMTPS id v4si58288wiz.2.2015.01.15.16.56.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 16:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of beni.cherniavsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c05::22e as permitted sender) client-ip=2a00:1450:400c:c05::22e; Original-Received: by mail-wi0-f174.google.com with SMTP id h11so987042wiw.1 for ; Thu, 15 Jan 2015 16:56:14 -0800 (PST) X-Received: by 10.180.24.138 with SMTP id u10mr1059513wif.80.1421369774441; Thu, 15 Jan 2015 16:56:14 -0800 (PST) Original-Received: by 10.194.5.131 with HTTP; Thu, 15 Jan 2015 16:55:54 -0800 (PST) In-Reply-To: X-Original-Sender: beni.cherniavsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of beni.cherniavsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c05::22e as permitted sender) smtp.mail=beni.cherniavsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:11754 Archived-At: --f46d04448067800dfd050cba70a0 Content-Type: text/plain; charset=UTF-8 http://docs.mathjax.org/en/latest/misc/epub.html lists quite a few epub readers that (try to) support MathML. Suspiciously, most or all desktop or mobile apps; I'm afraid physical ereader devices with proprietary software do much worse... -- https://github.com/mathjax/MathJax-node might be a lighter alternative than TeX for generating math SVGs. KaTeX converts math (currently supports much less than MathJax) to browser-independent HTML + CSS + web fonts. (You can use it for client-side JavaScript rendering, but there is also a command-line script to take math and produce static HTML fragment.) By independent I mean it doesn't tweak it per-browser like MathJax does[^1] in HTML output mode, but it does require somewhat modern browsers; no idea whether it will work in ePub readers... [^1]: MathJax 2.5 also introduced a browser-independent mode ("CommonHTML") but so far it's ugly, only suitable as fast preview. 2015-01-15 23:24 GMT+02:00 Thomas Arildsen : > After fiddling about a bit, I was also able to create fine-looking MathML > today, that is when opened in Calibre. I also tried opening it in Okular > with the ePub plugin and here it looked quite bad. Specifically, it seems > unable to place integral limits as sub- and superscript of the integral > sign. > Those readers are for my Ubuntu desktop PC. I have not tried my test > document in the Google e-reader I use on my phone yet. > Den 15/01/2015 21.32 skrev "a" : > >> The simple pandoc epubs I generated and displayed on my old Hanvon >> Reader and the Geeksphone looked just fine. >> Even the math is ok. Sure I would prefer SVG math, but it was quite >> readable. >> For plain text I don't see why the "pure ePub" is a problem. >> >> >> On Thu, Jan 15, 2015 at 12:30:01PM -0800, John MacFarlane wrote: >> > Seems to me it would not be hard to write a pandoc filter >> > that did this. There's an example filter in the >> > pandocfilters repository that converts tikz images in >> > LaTeX to images. Something like that could work here too, >> > only you'd match on 'Math' rather than 'RawBlock'. >> > >> > https://github.com/jgm/pandocfilters/blob/master/examples/tikz.py >> > >> > Filters can be written in Haskell or python (there are also >> > libraries to facilitate writing them in php and perl). >> > >> > >> > +++ Thomas Arildsen [Jan 15 15 00:59 ]: >> > > I have been experimenting with including maths in ebooks (ultimately >> > > because I would like to be able to publish my research as ebooks >> > > instead of PDF which I think is suboptimal for tablets etc.) One >> > > approach that sort of works for me is converting from Markdown with >> > > LaTeX maths to ePub where I can make Pandoc turn the maths into >> MathML. >> > > My problem is just that the MathML looks quite horrible in comparison >> > > to what LaTeX can usually produce in PDF etc. >> > > A fall-back solution for me could be to render the maths bitmapped >> and >> > > then include the images in the document. However, I recently figured >> > > out that ePub seems to support SVG as well and it is actually >> possible >> > > to turn LaTeX into SVG output (see e.g. >> http://dvisvg.sourceforge.net/ >> > > and http://svgkit.sourceforge.net/SVGLaTeX.html). So far I have >> > > succeeded in doing this quite manually, but I was wondering if it >> would >> > > be possible to make Pandoc able to automate this conversion of math >> > > formulae into SVG with subsequent inclusion of the SVG into the >> ePub? I >> > > have no experience in hacking Pandoc. >> > > Best regards, >> > > Thomas Arildsen >> > > >> > > -- >> > > You received this message because you are subscribed to the Google >> > > Groups "pandoc-discuss" group. >> > > To unsubscribe from this group and stop receiving emails from it, >> send >> > > an email to [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > > To post to this group, send email to >> > > [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > > To view this discussion on the web visit >> > > [3] >> https://groups.google.com/d/msgid/pandoc-discuss/dfcf2e4b-b377-4d48- >> > > be9f-de82088e7832%40googlegroups.com. >> > > For more options, visit [4]https://groups.google.com/d/optout. >> > > >> > >References >> > > >> > > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > > 2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > > 3. >> https://groups.google.com/d/msgid/pandoc-discuss/dfcf2e4b-b377-4d48-be9f-de82088e7832-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer >> > > 4. https://groups.google.com/d/optout >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "pandoc-discuss" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/20150115203001.GA10846%40protagoras.berkeley.edu >> . >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "pandoc-discuss" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/pandoc-discuss/C_UIh0gDpwU/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/20150115203204.GB2131%40jhs-think >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/CAFQUsiZNNx%3DcMG9%2BUsrc5E%3D_sfN1Y7-3mF2Yv0OCmXdD4FJ0XA%40mail.gmail.com > > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CALJxei%2BTNrf%2BLGZTOQF_KKN%2BfYjBXxJyS51y1wYSyf2pQxQ19w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --f46d04448067800dfd050cba70a0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
http://docs.mathjax.org/en/latest/misc/epub.html l= ists quite a few epub readers that (try to) support=C2=A0MathML.
Su= spiciously, most or all desktop or mobile apps; I'm afraid physical ere= ader devices with proprietary software do much worse...

--

https://github.com/mathjax/MathJax-node mi= ght be a lighter alternative than TeX for generating math SVGs.
<= br>
KaTeX converts math (currently supports much less than MathJa= x) to=C2=A0browser-independent HTML + CSS + web fonts.
(You can u= se it for client-side JavaScript rendering, but there is also a command-lin= e script to take math and produce static HTML fragment.)
By indep= endent I mean it doesn't tweak it per-browser like MathJax does[^1] in = HTML output mode, but it does require somewhat modern browsers; no idea whe= ther it will work in ePub readers...

[^1]: MathJax= 2.5 also introduced a browser-independent mode ("CommonHTML") bu= t so far it's ugly, only suitable as fast preview.

2015-01-15 23:24 GMT+02:00 Thoma= s Arildsen <thomas-QIklGeMt0Llg9hUCZPvPmw@public.gmane.org>:

After fiddling about a bit, I was also able to create fine-looki= ng MathML today, that is when opened in Calibre. I also tried opening it in= Okular with the ePub plugin and here it looked quite bad. Specifically, it= seems unable to place integral limits as sub- and superscript of the integ= ral sign.
Those readers are for my Ubuntu desktop PC. I have not tried my test docume= nt in the Google e-reader I use on my phone yet.

Den 15/01/2015 21.32 skrev "a" <schleija@hu-berlin.= de>:
The simple p= andoc epubs I generated and displayed on my old Hanvon
Reader and the Geeksphone looked just fine.
Even the math is ok. Sure I would prefer SVG math, but it was quite readabl= e.
For plain text I don't see why the "pure ePub" is a problem.<= br>

On Thu, Jan 15, 2015 at 12:30:01PM -0800, John MacFarlane wrote:
> Seems to me it would not be hard to write a pandoc filter
> that did this.=C2=A0 There's an example filter in the
> pandocfilters repository that converts tikz images in
> LaTeX to images.=C2=A0 Something like that could work here too,
> only you'd match on 'Math' rather than 'RawBlock'.=
>
> https://github.com/jgm/pandocfilters/blob/master/= examples/tikz.py
>
> Filters can be written in Haskell or python (there are also
> libraries to facilitate writing them in php and perl).
>
>
> +++ Thomas Arildsen [Jan 15 15 00:59 ]:
> >=C2=A0 I have been experimenting with including maths in ebooks (u= ltimately
> >=C2=A0 because I would like to be able to publish my research as e= books
> >=C2=A0 instead of PDF which I think is suboptimal for tablets etc.= ) One
> >=C2=A0 approach that sort of works for me is converting from Markd= own with
> >=C2=A0 LaTeX maths to ePub where I can make Pandoc turn the maths = into MathML.
> >=C2=A0 My problem is just that the MathML looks quite horrible in = comparison
> >=C2=A0 to what LaTeX can usually produce in PDF etc.
> >=C2=A0 A fall-back solution for me could be to render the maths bi= tmapped and
> >=C2=A0 then include the images in the document. However, I recentl= y figured
> >=C2=A0 out that ePub seems to support SVG as well and it is actual= ly possible
> >=C2=A0 to turn LaTeX into SVG output (see e.g. http://dvisvg.sourceforge.net/
> >=C2=A0 and
http://svgkit.sourceforge.net/SVGLaTeX.html). So far= I have
> >=C2=A0 succeeded in doing this quite manually, but I was wondering= if it would
> >=C2=A0 be possible to make Pandoc able to automate this conversion= of math
> >=C2=A0 formulae into SVG with subsequent inclusion of the SVG into= the ePub? I
> >=C2=A0 have no experience in hacking Pandoc.
> >=C2=A0 Best regards,
> >=C2=A0 Thomas Arildsen
> >
> >=C2=A0 --
> >=C2=A0 You received this message because you are subscribed to the= Google
> >=C2=A0 Groups "pandoc-discuss" group.
> >=C2=A0 To unsubscribe from this group and stop receiving emails fr= om it, send
> >=C2=A0 an email to [1]pandoc-discuss+unsubscribe@googlegro= ups.com.
> >=C2=A0 To post to this group, send email to
> >=C2=A0 [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> >=C2=A0 To view this discussion on the web visit
> >=C2=A0 [3]https://groups.google.com/d/msgi= d/pandoc-discuss/dfcf2e4b-b377-4d48-
> >=C2=A0 be9f-de82088e7832%40googlegroups.com.
> >=C2=A0 For more options, visit [4]https://groups.google.com/d/optout. > >
> >References
> >
> >=C2=A0 1. mailto:pandoc-discuss+unsubscribe@googlegroups.c= om
> >=C2=A0 2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> >=C2=A0 3. https://groups.google.com/d/ms= gid/pandoc-discuss/dfcf2e4b-b377-4d48-be9f-de82088e7832-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?ut= m_medium=3Demail&utm_source=3Dfooter
> >=C2=A0 4. https://groups.google.com/d/optout
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. > To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20= 150115203001.GA10846%40protagoras.berkeley.edu.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Goog= le Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://g= roups.google.com/d/topic/pandoc-discuss/C_UIh0gDpwU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/20150115203204.GB2131%= 40jhs-think.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFQUsiZNNx%3= DcMG9%2BUsrc5E%3D_sfN1Y7-3mF2Yv0OCmXdD4FJ0XA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://g= roups.google.com/d/msgid/pandoc-discuss/CALJxei%2BTNrf%2BLGZTOQF_KKN%2BfYjB= XxJyS51y1wYSyf2pQxQ19w%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--f46d04448067800dfd050cba70a0--