public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Smart math rendering in HTML
@ 2020-11-27 19:11 Julien Dutant
       [not found] ` <6fc68f44-3b9e-43e8-8260-0eaa6abcb047n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Dutant @ 2020-11-27 19:11 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1653 bytes --]

Hi all!

Pandoc is already very smart, but I'd like to make it even smarter when 
rendering math that can/cannot be handled by MathJax or others. 

I have to render a bunch of markdown files in both LaTeX and HTML, and some 
of them rely on special latex packages (xymatrix, bussproofs, fitch, ...) 
that MathJax, codecogs.org and others can't process. Ideally, I would want 
to my pandoc conversion to pre-render the TeX as images when it is 
necessary, but only when necessary. 

My default plan is this: manually mark up the maths environments that need 
to be pre-rendered (native span or div with class "prerender"), and process 
those with a lua filter along the lines of the diagram filter. 
<https://pandoc.org/lua-filters.html#building-images-with-tikz> 

Ideally of course I'd like pandoc to figure out by itself whether 
pre-rendering is needed. Even if that significantly slowed down processing, 
e.g. because pandoc would itself run every formula through the target 
renderer and check whether it returns an error code. And even if that was 
only available for one rendering method (MathJax).

Is the default plan the best feasible right now? Is the smart solution 
something that could be done at all?

Any suggestions welcome!

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6fc68f44-3b9e-43e8-8260-0eaa6abcb047n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2096 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Smart math rendering in HTML
       [not found] ` <6fc68f44-3b9e-43e8-8260-0eaa6abcb047n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-11-27 21:42   ` John MacFarlane
       [not found]     ` <m2k0u6qxxu.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John MacFarlane @ 2020-11-27 21:42 UTC (permalink / raw)
  To: Julien Dutant, pandoc-discuss

Julien Dutant <julien.dutant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Ideally of course I'd like pandoc to figure out by itself whether 
> pre-rendering is needed. Even if that significantly slowed down processing, 
> e.g. because pandoc would itself run every formula through the target 
> renderer and check whether it returns an error code. And even if that was 
> only available for one rendering method (MathJax).

Pandoc won't do that.  But you could have a filter do that.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Smart math rendering in HTML
       [not found]     ` <m2k0u6qxxu.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2020-11-28  2:08       ` Julien Dutant
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Dutant @ 2020-11-28  2:08 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]

Thanks! I'll get on with the simple manual-markup filter first. For a 
smarter one I guess I'd need a way of doing dry-runs of MathJax and get 
error codes when some math isn't processed. The API documentation for v3 
isn't up yet, but from a quick look a v2 I didn't spot an easy way to do it.
On Friday, November 27, 2020 at 9:42:24 PM UTC John MacFarlane wrote:

> Julien Dutant <julien...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Ideally of course I'd like pandoc to figure out by itself whether 
> > pre-rendering is needed. Even if that significantly slowed down 
> processing, 
> > e.g. because pandoc would itself run every formula through the target 
> > renderer and check whether it returns an error code. And even if that 
> was 
> > only available for one rendering method (MathJax).
>
> Pandoc won't do that. But you could have a filter do that.
>
>

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/a2181bc2-fa41-4b81-aa8c-7f7673c8a2aan%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1882 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-28  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 19:11 Smart math rendering in HTML Julien Dutant
     [not found] ` <6fc68f44-3b9e-43e8-8260-0eaa6abcb047n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-11-27 21:42   ` John MacFarlane
     [not found]     ` <m2k0u6qxxu.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-11-28  2:08       ` Julien Dutant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).