zlacker

[parent] [thread] 3 comments
1. thdc+(OP)[view] [source] 2023-11-20 19:29:21
I use TikZJax https://tikzjax.com/ (wasm tikz).

It works well, but you have to figure out the markup and dynamically styling the images are difficult; For example, to make darkmode work, I have to apply css filters over the generated svgs.

It also doesn't show anything if javascript is not enabled, so I duplicate the contents into a noscript tag as part of my site's "build" process so users can at least know a tikz diagram is supposed to be there.

I have an entire custom build process though, so that might be why it was straightforward for me to incorporate it.

replies(1): >>ajkjk+Xi
2. ajkjk+Xi[view] [source] 2023-11-20 20:40:05
>>thdc+(OP)
Ah interesting, I'll check it out. I figured this had to exist! It might be ideal --- I'm on a github-pages Jekyll site and I like how simple that is, but it means I can't do anything server-side at all, not even making custom Jekyll plugins.

How big does the resulting binary get?

edit: oh, looked at the demo on https://tikzjax-demo.glitch.me/ and it seems like it is just a couple MB. Not bad.

replies(1): >>thdc+vE
◧◩
3. thdc+vE[view] [source] [discussion] 2023-11-20 22:17:00
>>ajkjk+Xi
Yeah around 1.5mb transferred but less of an issue with caching of course.

You also won't have something nice like $$ or \[ \] and will have to put the

    <script type="text/tikz">
        \begin{tikzpicture}
            ...
        \end{tikzpicture}
    </script>
tags directly in your markdown, if that even works.
replies(1): >>ajkjk+LJ
◧◩◪
4. ajkjk+LJ[view] [source] [discussion] 2023-11-20 22:46:45
>>thdc+vE
Jekyll at least has an <% include %> tag that can introduce html into a markdown document, so I can probably use that. Tbd. The $$ is awkward though.
[go to top]