public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Colored equations? (particularly compiling to HTML)
@ 2020-03-19  3:27 Gwern Branwen
       [not found] ` <CAMwO0gyY9o7hurpkaWaOQws5xNN1gV9kjHV9RsEp3h_K8fDWJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Gwern Branwen @ 2020-03-19  3:27 UTC (permalink / raw)
  To: pandoc-discuss

Has anyone found a good way to do annotated colored equations in Pandoc?

A Twitter thread (
https://twitter.com/kwinkunks/status/1232333955501826051 ) of examples
of colored equations like https://row1.ca/pixels-and-their-neighbors
with many implemented in Latex and/or Tikz (
http://www.texample.net/tikz/examples/ ). Rubricated* or colored
equations would be nice to have for Markdown->HTML and other formats.

In an earlier discussion of Pandoc->Docx (
https://groups.google.com/d/msgid/pandoc-discuss/aa5ab201-d3a6-44e2-807d-3f92a97f7a8b%40googlegroups.com
), John says that the texmath package doesn't support the necessary
TeX color library, so you can't simply write out color annotations in
native TeX expressions with $/$$.
People writing Latex->PDF presumably can just use that color library directly.

What other option have people tried?
One could write Latex or anything else and screenshot it as a figure,
but that's not too pleasant or editable.
Could one use the Tikz filter (
https://pandoc.org/lua-filters.html#building-images-with-tikz
https://github.com/jgm/pandocfilters/blob/master/examples/tikz.py
https://github.com/jgm/pandocfilters/blob/master/examples/tikz-sample.md
) or something much like it, to automatically generate a
figure/screenshot? It doesn't yield the same MathML or whatever, and
it might be a little tricky to integrate into Hakyll (unless one
inlined the image as a data-uri? it'd be relatively small).
That might be equivalent to
https://github.com/liamoc/latex-formulae#readme ** which generates
inline PNGs, and https://taeer.bar-yam.me/blog/posts/hakyll-tikz/
which generates inline SVGs.

* https://www.gwern.net/Red
** examples: http://liamoc.net/posts/2017-07-08-abstraction/index.html
http://liamoc.net/posts/2015-11-10-patch-theory/index.html ;
incidentally, he has some very impressive literate Agda code
implementation, examples in
http://liamoc.net/posts/2015-08-23-verified-compiler

-- 
gwern


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

end of thread, other threads:[~2021-11-18 23:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  3:27 Colored equations? (particularly compiling to HTML) Gwern Branwen
     [not found] ` <CAMwO0gyY9o7hurpkaWaOQws5xNN1gV9kjHV9RsEp3h_K8fDWJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-09-06  3:16   ` Gwern Branwen
     [not found]     ` <CAMwO0gzotcqk5J0uHvp3YZqmfhmistbkbv7Mv-QLq5vqdbD7LQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-09-07 18:04       ` John MacFarlane
     [not found]         ` <m28sdlv4ys.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-09-07 23:48           ` Gwern Branwen
     [not found]             ` <CAMwO0gx3i0E-C4c35sX+Xcwwu+t5+TrRcOnQ3OSnNqsx6eYMFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-18 23:33               ` Advanced equation typesetting, "Nota" " Gwern Branwen

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