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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

TeX and Typst: Layout Models (2024)

240 点作者 fngjdflmdflg3 个月前

12 条评论

svat3 个月前
This is a nice post; a few comments:<p>* TeX&#x27;s boxes-and-glue-and-penalties model is remarkably simple and flexible, as the author says. I&#x27;ve long been planning to write a post about this; the Knuth–Plass paper has some beautiful examples of how much you can cleverly achieve with such simple primitives. Really a model of elegance.<p>* This simplicity allows some ingenious solutions. With TeX (especially LuaTeX) one <i>can</i> do things that require knowledge of where on what page a paragraph is on: see for example this &quot;demo&quot; of mine: <a href="https:&#x2F;&#x2F;tex.stackexchange.com&#x2F;a&#x2F;403353" rel="nofollow">https:&#x2F;&#x2F;tex.stackexchange.com&#x2F;a&#x2F;403353</a> — of course one is fighting the system to some extent, but it is possible.<p>* Of the three “Challenges” it discusses, the first two “Varying container width” and “Side-floating elements” are both examples of things that are possible in TeX with caveats (parshape and wrapfig), but currently not possible in Typst — would be nice to see those limitations removed in Typst in a clean way.<p>* In the TeX world, note that there is Martin Ruckert&#x27;s ongoing HINT project, which moves some of the TeX layout to the client (custom viewer), and thus supports arbitrarily varying widths (really cool to read a hint &quot;book&quot; on a phone): <a href="https:&#x2F;&#x2F;hint.userweb.mwn.de&#x2F;#:~:text=TEX-,HINT,-%2C%20following%20a%20tradition" rel="nofollow">https:&#x2F;&#x2F;hint.userweb.mwn.de&#x2F;#:~:text=TEX-,HINT,-%2C%20follow...</a> (demo videos here: <a href="https:&#x2F;&#x2F;hint.userweb.mwn.de&#x2F;hint&#x2F;video&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hint.userweb.mwn.de&#x2F;hint&#x2F;video&#x2F;</a> and articles in TUGboat: <a href="https:&#x2F;&#x2F;tug.org&#x2F;TUGboat&#x2F;Contents&#x2F;listauthor.html#Ruckert,Martin" rel="nofollow">https:&#x2F;&#x2F;tug.org&#x2F;TUGboat&#x2F;Contents&#x2F;listauthor.html#Ruckert,Mar...</a> )<p>On the whole, happy to see this post and that more attention is getting paid to text layout.
评论 #43058760 未加载
natemcintosh3 个月前
This was a really great write-up, and gives me a lot of hope for the future of Typst. I think one of the best ways to overcome the enormous momentum of TeX is to point out its limitations (while still keeping an eye on Typst&#x27;s limitations), and explain how Typst overcomes them.
评论 #43052148 未加载
aidenn03 个月前
I remember in word for windows (Either 2 or 6, not sure) on my 40MHz 386, you could watch it reflowing text if you edited a paragraph near the beginning of a multi-page document. It would correct for widows and orphans, which would cause surrounding pages to potentially do the same. It could take a non-trivial amount of time to stabilize, and if you printed a document before it did, you could end up with duplicated or missing lines at page breaks.
zellyn3 个月前
For reference, this blog post appears to be by the same person who is the overwhelmingly primary contributor to Typst: See <a href="https:&#x2F;&#x2F;github.com&#x2F;typst&#x2F;typst&#x2F;graphs&#x2F;contributors">https:&#x2F;&#x2F;github.com&#x2F;typst&#x2F;typst&#x2F;graphs&#x2F;contributors</a>
评论 #43053200 未加载
评论 #43055206 未加载
watersb3 个月前
Typst is a re-flowable document description language; TeX spends more computation on the One True text justification and hyphenation paragraph builder.<p>PDF has recently implemented a limited reflow feature by marking up text elements with metadata tags originally introduced to add accessibility features, hints for text to speech...<p>Meanwhile, Amazon has moved new books and user-submitted documents from its own Kindle format to ePub.<p>ePub is the e-book standard format that extends a subset of HTML.<p>Web browser teams have been hurling themselves against the walls of nearly-intractable layout cases for decades now.<p>We take it for granted: on your Kindle e-ink reader, change the font size. Boom: the whole book has to re-compute its layout.<p>Typst is far more computationally efficient, even elegant, but as yet it can&#x27;t flow text around embedded sidebars or images.
__mharrison__3 个月前
Great article. Appears to be one of those articles where writing it forces you to think and leads to new solutions like relayout.<p>As for myself I&#x27;ve completely abandoned LaTeX for Typst and couldn&#x27;t be happier. My life will be better if I never have to touch LaTeX again. (Have written almost a dozen books with LaTeX.)
sa463 个月前
&gt; As we’ve seen, TeX’s model falls short on everything that requires knowledge of exact vertical positions:<p>Interestingly, classical CSS had a similar limitation, that height is determined by content size, leading practitioners to search for the Holy Grail [1].<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Holy_grail_(web_design)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Holy_grail_(web_design)</a>
评论 #43052211 未加载
评论 #43052367 未加载
red_admiral3 个月前
For my own work, I already find Typst superior to TeX and I use it in some of my PDF creation pipelines. One can debate the differences of math syntax, of course.<p>For documents whose source is likely to be shared or handed over to other people, writing in TeX rather than expecting them to learn a new language is still good citizenship.<p>The big differences for me are:<p>(1) TeX has the feeling of separating the author and editor, I get to write my stuff and someone else (Elsevier etc.) handles the template and layout. This is a good thing when the two are actually different people, but when I&#x27;m asked to do both (&quot;write this up in the style of that&quot;) there&#x27;s a whole lot of Yak Shaving to get it right. For Typst it&#x27;s much more intuitive to say here&#x27;s the page layout, this is the font to use. (yes XeTeX exists, but that has other problems over here)<p>(2) TeX ends up in dependency hell sooner or later where package X is incompatible with Y when you&#x27;ve also loaded Z. There&#x27;s a lot in the comprehensive LaTeX symbol list where you just want to load some symbol to draw a triangle and you end up fighting the Type1&#x2F;Type3 fonts thing and getting stmaryrd to play nice. I still don&#x27;t have a clean solution for making some basic shapes (circle, triangles pointing in several directions, square, diamond) that come in outline and filled versions and take up space exactly from the baseline to the cap line (I could probably live with just the x-height instead).
评论 #43058041 未加载
评论 #43060482 未加载
tolerance3 个月前
The one thing the Typst could do to eclipse TeX is market itself to authors outside of STEM disciplines who still possess a willingness to get their hands techy.<p>I view Typst on the high-end of software that can encourage more people who are into the &quot;arts&quot; or &quot;humanities&quot; into coding.<p>I used it once to typeset a booklet and had a lot of fun. One of the benefits of it being new and having an engaged community and being just fun to use is that I got to explore different workarounds to achieve certain layouts, learning more about how it works along the way.<p>Troff is lots of fun too.
Upvoter333 个月前
I love a lot about Typst. Hope it keeps growing and getting better!
replete3 个月前
Great write up. Looking forward to a day when a Typst doc framework is a reality.
n_eutrino3 个月前
life is short, use typst.