TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

TikZJax: Embedding LaTeX Drawings in HTML

137 pointsby steventhedevabout 1 month ago

7 comments

icsabout 1 month ago
Jim Fowler seemed like Calculus&#x27; biggest hype man when the MOOC ball was just starting to roll. If you&#x27;re looking to brush up and like the more energetic&#x2F;engaging style I&#x27;d recommend checking out his videos on YouTube or elsewhere.<p>&gt; Using web2js, the Pascal source of tex is compiled to WebAssembly; the latex format is loaded (without all the hyphenation data), and [...] is executed. Then core is dumped; the resulting core is compressed, and by reloading the dumped core in the browser, it is possible to very quickly get to a point where TikZ can be executed. By using an SVG driver for PGF along with dvi2html, the DVI output is converted to an SVG.<p>This is the kind of hack I&#x27;m here for.
评论 #43750830 未加载
评论 #43749316 未加载
apetresc30 days ago
Funny seeing this on the front page – I&#x27;m coding a project as I&#x27;m browsing this that makes heavy use of TikZJax.<p>Overall, I&#x27;m impressed by how seamlessly it works when it does work. But it&#x27;s not perfect:<p>- Some core library functions (for example, most types of fill patterns) simply don&#x27;t work or aren&#x27;t implemented for some reason.<p>- There are a few long-standing bugs. For instance, if using the intersections library to compute the intersection of a line and a circle, it straight-up crashes the entire TikZJax process. Intersections of two lines or two circles are fine, but circle+line fails. My attempts at diagnosing this seem to indicate that it&#x27;s running out of stack space, so maybe the original TikZ code uses some inefficient recursive algorithm to compute this intersection, and this exceeds some stack size limit that the WebAssembly version introduces. I&#x27;m not sure and I haven&#x27;t been able to get much traction.<p>- The project doesn&#x27;t seem to get <i>any</i> love from the original developers anymore. I&#x27;ve filed multiple bugs for months now that never get any form of acknowledgement.<p>- The build process is pretty convoluted and difficult to reproduce (to try to fix those aforementioned bugs myself), which I guess is what you&#x27;d expect from a project that attempts to cross-compile a 20-year-old macro package for a 50-year-old Pascal codebase for rendering in the browser.<p>Overall I&#x27;m very glad TikZJax exists and there&#x27;s still no better-looking and convenient-to-author diagramming language than TikZ itself. But there&#x27;s definitely rough edges.
评论 #43750812 未加载
评论 #43748430 未加载
frumplestlatzabout 1 month ago
Using a “core dump” (dumping the webassembly heap) is an interesting optimization approach with historical precedent both in TeX itself and projects like Emacs (dump&#x2F;unexec) — <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;emacs&#x2F;manual&#x2F;html_node&#x2F;elisp&#x2F;Building-Emacs.html" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;emacs&#x2F;manual&#x2F;html_node&#x2F;elisp&#x2F;Bu...</a><p>It’s also notoriously fragile and non-portable on native targets; I’m curious how one implements it under webassembly, and how it compares.
评论 #43747964 未加载
评论 #43750785 未加载
xenonite30 days ago
While live rendering is nice, I suppose that generating static SVGs that are embedded in a static webpage generator are more fruitful for the typical case. A quick search yielded this: <a href="https:&#x2F;&#x2F;polbarrachina.com&#x2F;2022&#x2F;05&#x2F;23&#x2F;latex-and-tikz-in-jekyll-posts" rel="nofollow">https:&#x2F;&#x2F;polbarrachina.com&#x2F;2022&#x2F;05&#x2F;23&#x2F;latex-and-tikz-in-jekyl...</a>
评论 #43748948 未加载
Garlefabout 1 month ago
Hm. Either that page or the tech itself is not great on mobile.
评论 #43747496 未加载
评论 #43747961 未加载
klabetron30 days ago
Holy smokes. That’s a name I haven’t heard in a while. I submitted many calculus homework assignments in LaTeX because Jim introduced it to me back at our high school. (Go Mankato West Scarlets!)
评论 #43750738 未加载
ycombinatrix29 days ago
this looks cool. i guess i would generally prefer to do the SVG rendering on the server rather than on the client.