public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* math2svg Lua filter now available!
@ 2021-01-16 20:42 Serf Stoorband
       [not found] ` <5bcd2b35-8e92-4c98-9768-ba498c97383eo-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Serf Stoorband @ 2021-01-16 20:42 UTC (permalink / raw)
  To: pandoc-discuss


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

This is to inform the Pandoc community that the math2svg Lua filter is now 
available from:
https://github.com/pandoc/lua-filters/tree/master/math2svg

math2svg converts LaTeX math 
<https://en.wikibooks.org/wiki/LaTeX/Mathematics> to MathJax 
<https://www.mathjax.org/> generated scalable vector graphics (SVG) 
<https://en.wikipedia.org/wiki/Scalable_Vector_Graphics> for insertion into 
the output document in a standalone manner. SVG output is in any of the available 
MathJax fonts <https://docs.mathjax.org/en/latest/output/fonts.html>.


This is useful when a CSS paged media engine (such as Prince XML 
<https://princexml.com/>) cannot process complex JavaScript as required by 
MathJax. See: https://www.print-css.rocks for information about CSS paged 
media, a W3C standard <https://www.w3.org/TR/css-page-3/>.


No Internet connection is required when generating or viewing SVG formulas, 
resulting in both absolute privacy and offline, standalone robustness.


Personally, I have been using it for quite some time to generate PDFs with 
MathJax generated formulas in an unattended typesetting workflow using 
Prince XML.

Here is a brief sample document:
https://hamwaves.com/zc.measuring/en/zc.measuring.letter.pdf

More intricate documents with Markdown source, makefile and CSS are 
available from the same web site <https://hamwaves.com/>.

Kind regards,
Serge Y. Stroobandt



-- 
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/5bcd2b35-8e92-4c98-9768-ba498c97383eo%40googlegroups.com.

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

[-- Attachment #2: zc.measuring.a4.pdf --]
[-- Type: application/pdf, Size: 130434 bytes --]

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

* Re: math2svg Lua filter now available!
       [not found] ` <5bcd2b35-8e92-4c98-9768-ba498c97383eo-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-01-17 21:43   ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
       [not found]     ` <04d0e359-5cab-4e1f-a2b4-0b4a20912fa7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-01-17 21:43 UTC (permalink / raw)
  To: pandoc-discuss


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

What's the difference with jgm's similar package?

On Saturday, January 16, 2021 at 12:42:07 PM UTC-8 stoo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:

> This is to inform the Pandoc community that the math2svg Lua filter is 
> now available from:
> https://github.com/pandoc/lua-filters/tree/master/math2svg
>
> math2svg converts LaTeX math 
> <https://en.wikibooks.org/wiki/LaTeX/Mathematics> to MathJax 
> <https://www.mathjax.org/> generated scalable vector graphics (SVG) 
> <https://en.wikipedia.org/wiki/Scalable_Vector_Graphics> for insertion 
> into the output document in a standalone manner. SVG output is in any of the
>  available MathJax fonts 
> <https://docs.mathjax.org/en/latest/output/fonts.html>.
>
>
> This is useful when a CSS paged media engine (such as Prince XML 
> <https://princexml.com/>) cannot process complex JavaScript as required 
> by MathJax. See: https://www.print-css.rocks for information about CSS 
> paged media, a W3C standard <https://www.w3.org/TR/css-page-3/>.
>
>
> No Internet connection is required when generating or viewing SVG 
> formulas, resulting in both absolute privacy and offline, standalone 
> robustness.
>
>
> Personally, I have been using it for quite some time to generate PDFs with 
> MathJax generated formulas in an unattended typesetting workflow using 
> Prince XML.
>
> Here is a brief sample document:
> https://hamwaves.com/zc.measuring/en/zc.measuring.letter.pdf
>
> More intricate documents with Markdown source, makefile and CSS are 
> available from the same web site <https://hamwaves.com/>.
>
> Kind regards,
> Serge Y. Stroobandt
>
>
>
>

-- 
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/04d0e359-5cab-4e1f-a2b4-0b4a20912fa7n%40googlegroups.com.

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

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

* Re: math2svg Lua filter now available!
       [not found]     ` <04d0e359-5cab-4e1f-a2b4-0b4a20912fa7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-01-18 10:06       ` Albert Krewinkel
       [not found]         ` <87im7ud0e4.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Albert Krewinkel @ 2021-01-18 10:06 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Attempting an answer:

The main difference is Haskell vs. Lua filter, i.e. Serge's filter can
be used without having a Haskell stack installed. It is also very
configurable, allowing, e.g., to chose the font and SVG image properties
via metadata settings.

The filter by jgm has a cache to avoid repeated rendering of the same
images. It thereby might be faster when rendering both display and
inline math, as inline math often contains single variables like $x$.
PRs to add this to the Lua version would be welcome.

Serge's README also provides CSS snippets to number equations; this
might be of interest no matter which filter is used.

For reference, the filter by jgm is here:
https://github.com/jgm/pandoc-tex2svg

christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> What's the difference with jgm's similar package?
>
> On Saturday, January 16, 2021 at 12:42:07 PM UTC-8 stoo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>
>  This is to inform the Pandoc community that the math2svg Lua filter is now available from:
>  https://github.com/pandoc/lua-filters/tree/master/math2svg
>
>  math2svg converts LaTeX math to MathJax generated scalable vector graphics (SVG) for insertion into the output document in a
>  standalone manner. SVG output is in any of the available MathJax fonts.
>
>  This is useful when a CSS paged media engine (such as Prince XML) cannot process complex JavaScript as required by MathJax. See:
>  https://www.print-css.rocks for information about CSS paged media, a W3C standard.
>
>  No Internet connection is required when generating or viewing SVG formulas, resulting in both absolute privacy and offline, standalone
>  robustness.
>
>  Personally, I have been using it for quite some time to generate PDFs with MathJax generated formulas in an unattended typesetting
>  workflow using Prince XML.
>
>  Here is a brief sample document:
>  https://hamwaves.com/zc.measuring/en/zc.measuring.letter.pdf
>
>  More intricate documents with Markdown source, makefile and CSS are available from the same web site.
>
>  Kind regards,
>  Serge Y. Stroobandt


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: math2svg Lua filter now available!
       [not found]         ` <87im7ud0e4.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2021-01-19  8:31           ` Serf Stoorband
       [not found]             ` <84ea71c1-1051-4bca-9aa9-dcfc82b81bfcn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Serf Stoorband @ 2021-01-19  8:31 UTC (permalink / raw)
  To: pandoc-discuss


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

Albert did a great job at summarising the differences between both filters.

For a trip along memory lane; I have a long history of employing LaTeX math 
SVG Pandoc filters in production.
My first installment seems to date back to December 2013 
<https://stackoverflow.com/questions/41119436/pandoc-filter-mimicking-default-mathml-conversion>, 
with a second version published in this group in February 2015 
<https://groups.google.com/g/pandoc-discuss/c/MJggAXUmOII/m/PjkR8ILr_58J>. 
This is some months before John dabbled with this and explains the 
independent development tracks of both filters.

Finally, I was unaware of the SVG caching happening in John's Haskell 
filter.
Albert may be happy to read that he has a pull request waiting for him with 
SVG caching for my Lua filter.
Works a charm.

-- 
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/84ea71c1-1051-4bca-9aa9-dcfc82b81bfcn%40googlegroups.com.

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

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

* Re: math2svg Lua filter now available!
       [not found]             ` <84ea71c1-1051-4bca-9aa9-dcfc82b81bfcn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-01-19  9:22               ` Albert Krewinkel
       [not found]                 ` <87ft2xcmcx.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Albert Krewinkel @ 2021-01-19  9:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Oh, there's another advantage: the SVGs are added as images to all
non-HTML formats, so the filter can be used with all publishing formats,
not just HTML and EPUB.

Serf Stoorband <stoorband-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Albert may be happy to read that he has a pull request waiting for him with
> SVG caching for my Lua filter.
> Works a charm.

Great news, thanks! I'll take a look right away.


--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: math2svg Lua filter now available!
       [not found]                 ` <87ft2xcmcx.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-11-08 11:53                   ` Randolph M. Fritz
  0 siblings, 0 replies; 6+ messages in thread
From: Randolph M. Fritz @ 2022-11-08 11:53 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks for this - it looks great! Works with weasyprint, too, for 
generating PDFs.

On Tuesday, January 19, 2021 at 1:22:32 AM UTC-8 Albert Krewinkel wrote:

> Oh, there's another advantage: the SVGs are added as images to all
> non-HTML formats, so the filter can be used with all publishing formats,
> not just HTML and EPUB.
>
> Serf Stoorband <stoo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Albert may be happy to read that he has a pull request waiting for him 
> with
> > SVG caching for my Lua filter.
> > Works a charm.
>
> Great news, thanks! I'll take a look right away.
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/cf3705ab-5a12-4717-bee1-c99af7eec47en%40googlegroups.com.

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

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

end of thread, other threads:[~2022-11-08 11:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16 20:42 math2svg Lua filter now available! Serf Stoorband
     [not found] ` <5bcd2b35-8e92-4c98-9768-ba498c97383eo-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-01-17 21:43   ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found]     ` <04d0e359-5cab-4e1f-a2b4-0b4a20912fa7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-01-18 10:06       ` Albert Krewinkel
     [not found]         ` <87im7ud0e4.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-01-19  8:31           ` Serf Stoorband
     [not found]             ` <84ea71c1-1051-4bca-9aa9-dcfc82b81bfcn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-01-19  9:22               ` Albert Krewinkel
     [not found]                 ` <87ft2xcmcx.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-11-08 11:53                   ` Randolph M. Fritz

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).