TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

TikZJax: Embedding LaTeX Drawings in HTML

137 点作者 steventhedev23 天前

7 条评论

ics23 天前
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 未加载
apetresc23 天前
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 未加载
frumplestlatz23 天前
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 未加载
xenonite22 天前
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 未加载
Garlef23 天前
Hm. Either that page or the tech itself is not great on mobile.
评论 #43747496 未加载
评论 #43747961 未加载
klabetron22 天前
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 未加载
ycombinatrix22 天前
this looks cool. i guess i would generally prefer to do the SVG rendering on the server rather than on the client.