public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Gwern Branwen <gwern-v26ZT+9V8bxeoWH0uzbU5w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Colored equations? (particularly compiling to HTML)
Date: Wed, 18 Mar 2020 23:27:25 -0400	[thread overview]
Message-ID: <CAMwO0gyY9o7hurpkaWaOQws5xNN1gV9kjHV9RsEp3h_K8fDWJg@mail.gmail.com> (raw)

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


             reply	other threads:[~2020-03-19  3:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  3:27 Gwern Branwen [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMwO0gyY9o7hurpkaWaOQws5xNN1gV9kjHV9RsEp3h_K8fDWJg@mail.gmail.com \
    --to=gwern-v26zt+9v8bxeowh0uzbu5w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).