From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11745 Path: news.gmane.org!not-for-mail From: Paulo Ney de Souza Newsgroups: gmane.text.pandoc Subject: Re: Maths in ebooks Date: Thu, 15 Jan 2015 11:51:53 -0600 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a829ee76eca050cb48280 X-Trace: ger.gmane.org 1421344316 12151 80.91.229.3 (15 Jan 2015 17:51:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2015 17:51:56 +0000 (UTC) To: "pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org" Original-X-From: pandoc-discuss+bncBDYKBT675MKBBOP436SQKGQESBM65JQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 15 18:51:56 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ee0-f57.google.com ([74.125.83.57]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YBoaI-0006vc-Pf for gtp-pandoc-discuss@m.gmane.org; Thu, 15 Jan 2015 18:51:54 +0100 Original-Received: by mail-ee0-f57.google.com with SMTP id e49sf424360eek.2 for ; Thu, 15 Jan 2015 09:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version: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:sender:list-subscribe:list-unsubscribe; bh=xIA7ZK7BKwyg8p1bLbRIIYixKFuzVgh7ShP1C9Dgb6U=; b=r8Q817N/cssWOMh4XgMmDC6+mp9P0slAXFnbRDkLQeIFMvqeGbIbvKdcr6Eq4zK1E4 wgMUES9YQt4dq6VtVIUFCAxofS9YkLHDzVP+eDXGULCcg7aswtJvFUmd3rTSKggMdIPU yTG5x/Tq79VkbNNcwf3w3fWUXH5ryGCu/7DPaKoQnT2/8KEdq7E/6IXBfwVmE3/fVfSU 7itxaxhwSZ96s9QQO8vsMYt+4oG+9Ld7F3jD2i/0jtbGwHszp6dknPahjbSfNCY4HM1N SqD6xW+e98kHCAxpEeM3+SYlQo/reDinhKmCjUr0nNiMdx6GCjIKF0FNKdz693eOK7C3 sNOg== X-Received: by 10.152.8.68 with SMTP id p4mr17355laa.38.1421344314476; Thu, 15 Jan 2015 09:51:54 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.152.44.166 with SMTP id f6ls276047lam.39.gmail; Thu, 15 Jan 2015 09:51:53 -0800 (PST) X-Received: by 10.112.118.18 with SMTP id ki18mr427582lbb.15.1421344313526; Thu, 15 Jan 2015 09:51:53 -0800 (PST) Original-Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231]) by gmr-mx.google.com with ESMTPS id oi7si62062lbb.1.2015.01.15.09.51.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 09:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231; Original-Received: by mail-lb0-x231.google.com with SMTP id b6so14522616lbj.8 for ; Thu, 15 Jan 2015 09:51:53 -0800 (PST) X-Received: by 10.112.151.4 with SMTP id um4mr11521707lbb.50.1421344313403; Thu, 15 Jan 2015 09:51:53 -0800 (PST) Original-Received: by 10.112.87.172 with HTTP; Thu, 15 Jan 2015 09:51:53 -0800 (PST) In-Reply-To: X-Original-Sender: pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of pauloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c04::231 as permitted sender) smtp.mail=pauloney-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:11745 Archived-At: --047d7b3a829ee76eca050cb48280 Content-Type: text/plain; charset=UTF-8 Well... it is not so simple .... The first problem that arises is -- what is the "target ePub" -- specially since you are talking about displaying it in a device, and in a way that is better than PDF. The kind of ePub produced by Pandoc is a sort of a "pure ePub" -- it generates both ePub2 and ePub3 that passes validation with flying colors but displays very poorly on the devices (iPad, Kobo, Nook, Google Play, ADE, browser ePub display, converted to Kindle, etc ...). The main reasons for that can be broken in two classes: First is a CSS problem: Pandoc offers you a plain ePub and does not play much with the CSS, while a LOT of what makes a good ePub relies on CSS. This problem is resolvable, you just have to spend the time finding out what is the look you find the best and the target machine you want it for. The second class of problems is much harder: Not all ePub elements are supported by all manufacturers and programs and even then -- they make their own choice on HOW to support it and their OWN interpretation on how it should look like. Ultimately every one of these ePub rendering engines use an HTML rendering engine underneath, but manufacturers are not very open and forthcoming with what rendering engine they are using for their reader -- very few release that information and they change it all the time (now that rendering engines are becoming a standard and a commodity). There are even reports that a reader (Kobo) uses one rendering engine in one platform and another elsewhere. And up to now we have not even touched SVG ... and here the problem iterates again... SVG is a standard (as MathML is) and as such manufactures pick and choose which parts to use and support. It is fairly easy to make an SVG for a circle that will not display on one or another rendering engine. For a look at the ePub3 Support Grid you can check: http://epubtest.org/results/ and on http://epubtest.org/compare/ you can see what pieces of the SVG standard are supported by each reader. The problem is very similar to the one tackled by MathJax and KaTeX -- these are programs that stick their tongue out, feel the environment in the user machine (browser, rendering engine, installed fonts, etc ...) and prepare from sources the kind of HTML/MathML/CSS/Fonts it should be sent to that reader. We literally need to do the same for ePub, and start delivering the ePub that is appropriate for one or another device...that will take some work! Paulo Ney PS.Just a remark - SVGLaTeX is a defunct project right now. On Thu, Jan 15, 2015 at 2:59 AM, Thomas Arildsen wrote: > 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 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/dfcf2e4b-b377-4d48-be9f-de82088e7832%40googlegroups.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/CAFVhNZPeDbtt%2BTt3%3D8BYVX42XfFb%3D4RtaLGt29Ho-ik%3DQzeTSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. --047d7b3a829ee76eca050cb48280 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Wel= l... it is not so simple ....

The first problem that arises is= -- what is the "target ePub" -- specially since you are talking = about displaying it in a device, and in a way that is better than PDF.
<= br>
The kind of ePub produced by Pandoc is a sort of a "pure ePub= " -- it generates both ePub2 and ePub3 that passes validation with fly= ing colors but displays very poorly on the devices (iPad, Kobo, Nook, Googl= e Play, ADE, browser ePub display, converted to Kindle, etc ...). The main = reasons for that can be broken in two classes:

First is a CSS = problem: Pandoc offers you a plain ePub and does not play much with the CSS= , while a LOT of what makes a good ePub relies on CSS. This problem is reso= lvable, you just have to spend the time finding out what is=C2=A0 the look = you find the best and the target machine you want it for.

The = second class of problems is much harder: Not all ePub elements are supporte= d by all manufacturers and programs and even then -- they make their own ch= oice on HOW to support it and their OWN interpretation on how it should loo= k like.

Ultimately every one of these ePub rendering engines u= se an HTML rendering engine underneath, but manufacturers are not very open= and forthcoming with what rendering engine they are using for their reader= -- very few release that information and they change it all the time (now = that rendering engines are becoming a standard and a commodity). There are = even reports that a reader (Kobo) uses one rendering engine in one platform= and another elsewhere.

And up to now we have not even touched= SVG ... and here the problem iterates again... SVG is a standard (as MathM= L is) and as such manufactures pick and choose which parts to use and suppo= rt. It is fairly easy to make an SVG for a circle that will not display on = one or another rendering engine.

For a look at the ePub3 Suppo= rt Grid you can check: http://epub= test.org/results/ and on http:= //epubtest.org/compare/ you can see what pieces of the SVG standard are= supported by each reader.

The problem is very similar to the = one tackled by MathJax and KaTeX -- these are programs that stick their ton= gue out, feel the environment in the user machine (browser, rendering engin= e, installed fonts, etc ...) and prepare from sources the kind of HTML/Math= ML/CSS/Fonts it should be sent to that reader.

We literally n= eed to do the same for ePub, and start delivering the ePub that is appropri= ate for one or another device...that will take some work!

Paul= o Ney

PS.Just a remark - SVGLaTeX is a defunct project right n= ow.






<= /div>

= On Thu, Jan 15, 2015 at 2:59 AM, Thomas Arildsen <thomasarildsen@gm= ail.com> wrote:
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 o= f 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 Ma= thML looks quite horrible in comparison to what LaTeX can usually produce i= n PDF etc.
A fall-back solution for me could be to render the maths bitm= apped and then include the images in the document. However, I recently figu= red 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://svgk= it.sourceforge.net/SVGLaTeX.html). So far I have succeeded in doing thi= s quite manually, but I was wondering if it would be possible to make Pando= c able to automate this conversion of math formulae into SVG with subsequen= t inclusion of the SVG into the ePub? I have no experience in hacking Pando= c.
Best regards,

Thomas Arildsen

--
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/dfcf2e4b-b377-4d48-be9f-de82088e= 7832%40googlegroups.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:/= /groups.google.com/d/msgid/pandoc-discuss/CAFVhNZPeDbtt%2BTt3%3D8BYVX42XfFb= %3D4RtaLGt29Ho-ik%3DQzeTSg%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--047d7b3a829ee76eca050cb48280--