From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11750 Path: news.gmane.org!not-for-mail From: Thomas Arildsen Newsgroups: gmane.text.pandoc Subject: Re: Maths in ebooks Date: Thu, 15 Jan 2015 22:24:16 +0100 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=089e01419d8a7cbce7050cb77afe X-Trace: ger.gmane.org 1421357059 27456 80.91.229.3 (15 Jan 2015 21:24:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2015 21:24:19 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDXLTNWTUUDBBAPA4CSQKGQEIE5VWVQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 15 22:24:18 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wi0-f188.google.com ([209.85.212.188]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBrtq-0001tN-A8 for gtp-pandoc-discuss@m.gmane.org; Thu, 15 Jan 2015 22:24:18 +0100 Original-Received: by mail-wi0-f188.google.com with SMTP id em10sf8697wid.5 for ; Thu, 15 Jan 2015 13:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=eZSrxOkjZhtoe57f6m/drGOD4kWEYePm8Sa/8AHjeyc=; b=QQUNxuh1IvZO7XqMAR9rcf/l3ieoT4UPH/I+HsVXwXD05O0anGXyVVtDXPhknvzWZe td3ixcBNU1rMO4AYT2mVzGzHyoZbGE4u07G9i/0AM/xtsT8wXZyjnJk6TQolzjz+lRNi vVexbS66GyxYF2ir/xkYzbSl2ep7oDQT0wp12gcc+p6LOESz2sKiFUr36odJP28GNG0a mxm6PWf3GZq4h2BW2w/BxFgrdsK6fu6vvP6l2qGszFUgVAMvx4/ct6JUxuYU128U4XJA DOsN19m4xoXpv44E+QgxltWtIKmQvw/lPLXbjBN6zDEJ+1WoT3+bOatLcdkY0CgcItx4 h5sQ== X-Received: by 10.180.76.238 with SMTP id n14mr278919wiw.15.1421357058006; Thu, 15 Jan 2015 13:24:18 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.180.160.230 with SMTP id xn6ls202072wib.18.canary; Thu, 15 Jan 2015 13:24:17 -0800 (PST) X-Received: by 10.180.74.132 with SMTP id t4mr1431248wiv.3.1421357057323; Thu, 15 Jan 2015 13:24:17 -0800 (PST) Original-Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by gmr-mx.google.com with ESMTPS id oi7si109683lbb.1.2015.01.15.13.24.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 13:24:17 -0800 (PST) Received-SPF: pass (google.com: domain of thomasarildsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Original-Received: by mail-la0-f46.google.com with SMTP id ge10so6116504lab.5 for ; Thu, 15 Jan 2015 13:24:17 -0800 (PST) X-Received: by 10.152.5.7 with SMTP id o7mr12187615lao.26.1421357057094; Thu, 15 Jan 2015 13:24:17 -0800 (PST) Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.112.176.227 with HTTP; Thu, 15 Jan 2015 13:24:16 -0800 (PST) Original-Received: by 10.112.176.227 with HTTP; Thu, 15 Jan 2015 13:24:16 -0800 (PST) In-Reply-To: <20150115203204.GB2131@jhs-think> X-Original-Sender: thomasarildsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of thomasarildsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::22e as permitted sender) smtp.mail=thomasarildsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@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:11750 Archived-At: --089e01419d8a7cbce7050cb77afe Content-Type: text/plain; charset=UTF-8 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. --089e01419d8a7cbce7050cb77afe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

After fiddling about a bit, I was also able to create fine-l= ooking MathML today, that is when opened in Calibre. I also tried opening i= t 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 i= ntegral 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-vj2UJld5H2Nn68oJJulU0Q@public.gmane.org>:
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 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> >=C2=A0 To post to this group, send email to
> >=C2=A0 [2]pando= c-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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> >=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+un= subscribe-/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 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/CAFQUsiZNNx%3DcMG9%2BUsrc5E%3D_sfN1= Y7-3mF2Yv0OCmXdD4FJ0XA%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--089e01419d8a7cbce7050cb77afe--