[HN Gopher] Exploring Typst, a new typesetting system similar to...
___________________________________________________________________
Exploring Typst, a new typesetting system similar to LaTeX
Author : judell
Score : 107 points
Date : 2024-10-12 18:41 UTC (4 hours ago)
(HTM) web link (blog.jreyesr.com)
(TXT) w3m dump (blog.jreyesr.com)
| alphazard wrote:
| This is neat. I've used Latex before, and it definitely suffers
| from poor ergonomics. Both the language and tooling contribute to
| this.
|
| The selling point seems to be that this is more similar to
| Markdown. That makes sense, Markdown is objectively more common
| and has more users than Latex. I've used both, but Markdown way
| more often.
|
| Here's something I don't understand: it would be trivial to make
| Typst even more similar to Markdown, and yet it exists at some
| strange middle point in the language design space, arbitrarily
| far from Markdown.
| prettymuchnoone wrote:
| Could you give an example of how it could be more similar to
| Markdown? I recently used Typst for my bachelor's project and
| never really thought that it needed to be simpler
| huijzer wrote:
| Well maybe it's good to make it clear that it isn't markdown to
| avoid confusion? Also Typst has less syntactic sugar which also
| has benefits.
|
| More generally, I am really impressed by Typst's abstractions.
| I have typset my whole PhD thesis in it without needing any
| external packages. It was so easy to use the basic building
| blocks and write a few extra functions for the rest.
| raphman wrote:
| Is your template/source available by chance?
| llm_trw wrote:
| Markdown is a very poor language to try and use for anything
| other than single column typewriter like text.
|
| As evidenced by the fact that every project which uses it for
| more than that adds arbitrary extensions.
|
| The minimum viable language for non-mathematical technical
| documentation is reStructuredText.
| mbivert wrote:
| I'm not sure the selling point is similarity with markdown, but
| rather, to improve, or modernize LaTeX/TeX-the-language/s: TeX
| is _really_ archaic: if you 're curious, there's a series of
| articles by overleaf[0] detailing some of TeX's inner-working,
| quite insightful.
|
| I remember reading -- but can't find a source at the moment --
| that TeX originally didn't had counters; people came to rely on
| Church numerals[1] instead, before Knuth finally implemented
| them.
|
| EDIT: found out where I've read about it: [2]
|
| [0]: https://www.overleaf.com/learn/latex/A_six-
| part_series%3A_Ho...
|
| [1]: https://en.wikipedia.org/wiki/Church_encoding
|
| [2]: https://news.ycombinator.com/item?id=29713270
| sshine wrote:
| Places I've switched from LaTeX to Typst: My resume, research
| papers. Markdown was never a serious contender for my resume,
| since I want to control the rendering and the layout.
|
| Places I've switched from Markdown to Typst: Slides. There are
| some okay Markdown-to-HTML solutions, but they have this
| unfortunate side-effect that you move the slides to some other
| computer, and something breaks in your rendering. PDFs ftw.
| Animats wrote:
| > The selling point seems to be that this is more similar to
| Markdown.
|
| The problem is that extending Markdown syntax gets messy.
| #figure( image("image.jpg", width: 70%),
| caption: [ Observe the image in the picture
| ], ) <figure>
|
| This is kind of a strange blend of Markdown, CSS, JSON, and
| HTML. TeX at least has a consistent syntax.
| airstrike wrote:
| Strange to the untrained eye, perhaps. To me that just looks
| like a function. In a long document I recently wrote, I
| defined a custom function #let
| img(filepath, inset: 0.5em, caption: none) = {
| figure( box(inset: inset, stroke: 0.5pt + gray,
| image(filepath)), caption: caption );
| }
|
| and just used it like:
| #img("images/excel-5.0.png", caption: "Microsoft Excel 5.0
| was released in 1993.")
|
| edit: fixed unused inset param
| padjo wrote:
| Looks like it has a bug, the inset parameter is unused
| airstrike wrote:
| Whoops, thanks. Wrote this one-off and never needed to
| change the inset so didn't catch that. Fixed!
| smartmic wrote:
| These 6 lines actually put me off. Probably I have to read
| more about Typst syntax but, same for me, consistent syntax
| which covers necessary complexity wins over bending a markup
| language for purposes for which it was never intended.
| orangeboats wrote:
| It may be _similar_ to Markdown if you squint your eyes real
| hard, but it 's not Markdown.
|
| Furthermore, quoting a random snippet without any elaboration
| is unhelpful and only serves to confuse people (as it already
| did for the other comment!)
|
| # means "evaluate". figure(...) is the function being
| evaluated.
|
| The syntax inside figure(...) is fairly regular, not too
| different from what you'd see in typical programming
| languages (but with a document-oriented twist like the %).
|
| <figure> may seem to be related syntatically to #figure(...),
| but it's not. It's just a label. Like an HTML div tag with
| id="figure". It can very well be changed to <foo> in your
| example and it'd still work.
| SkiFire13 wrote:
| Was do you find inconsistent here? It seems pretty consistent
| to me, except maybe the <figure>
| SkiFire13 wrote:
| Personally, I don't really care about it being similar to
| Markdown. After all if someone wants Markdown they can just use
| that... For me the selling point is that it provides almost the
| same features as Latex except with a sane scripting language.
| This allows me to actually write my own scripts, as opposed to
| Latex where even understanding how basic stuff worked was a
| huge pain.
| vivekd wrote:
| I've tried typsit and Ive really been enjoying it. It's very easy
| to learn and easy to use. It's a new project so it can't as of
| yet replace the functionality of LaTeX's many packages. However
| it is good for quick and easy texts, it's replaced markdown and
| office for me for writing simple documents on a computer.
| darkteflon wrote:
| Love to hear some informed opinions on typst versus quarto.
| timeon wrote:
| There is overlap, with creating whole documents, but I can
| imagine at some point one could use Typst inside Quatro. (Like
| using Typst inside Obsidian.)
| kgwgk wrote:
| https://quarto.org/docs/output-formats/typst.html#raw-typst
| fourthark wrote:
| Yes, Typst is fully supported as an output language of
| Quarto.
|
| Exceptions: you'll need extensions for slides, some layouts.
| No books support, yet.
|
| [I work on this.]
| ternaryoperator wrote:
| Search in HN for Typst and you'll see this link is routinely
| posted and as little as three months ago got nearly 200
| comments.
| bitexploder wrote:
| Built my resume with typst and know of several other folks using
| it for serious document typesetting. It is a very nice and modern
| typesetting system and language that just feels easy to make it
| do what I want.
|
| It incorporates elements like templates and it is very easy to
| create reusable content "functions". It is everything I want out
| of LaTeX while being super fast and easy to use.
|
| Edit: pandoc can generate typst output if you want to explore :)
| sega_sai wrote:
| I was hoping that the syntax for equations would be borrowed from
| LaTeX but it is not the case unfortunately. I would like to
| switch away from LaTeX, but i think the syntax for equations in
| LaTeX is pretty sensible actually.
| Gualdrapo wrote:
| Have you tried with ConTeXt? As LaTeX, it's built atop TeX -
| though it's not as modular (and popular) it's more powerful.
|
| I'd like to like Typst, but (as mentioned the other day) it
| follows the same model as LaTeX - great for some predefined
| styles, but the moment you want or need something different
| you'd need to get third party plugins, and with that all the
| perks and cons they may have.
| elashri wrote:
| Previous discussions about Typst.
|
| https://news.ycombinator.com/item?id=41014941
|
| https://news.ycombinator.com/item?id=38354422
|
| https://news.ycombinator.com/item?id=38047224
|
| https://news.ycombinator.com/item?id=35250210
|
| https://news.ycombinator.com/item?id=34423590
| dang wrote:
| Thanks! Macroexpanded:
|
| _Typst: An easy to learn alternative for LaTex_ -
| https://news.ycombinator.com/item?id=41014941 - July 2024 (187
| comments)
|
| _Building the New Hypermedia Systems using Typst_ -
| https://news.ycombinator.com/item?id=40986352 - July 2024 (1
| comment)
|
| _No-Signup Typst Tools_ -
| https://news.ycombinator.com/item?id=40905678 - July 2024 (1
| comment)
|
| _Typst Symbol Classifier_ -
| https://news.ycombinator.com/item?id=39878069 - March 2024 (1
| comment)
|
| _Show HN: A no-frills CV template using Typst and YAML to
| version control CV data_ -
| https://news.ycombinator.com/item?id=38990197 - Jan 2024 (8
| comments)
|
| _TexText: Re-editable LaTeX / typst graphics for Inkscape_ -
| https://news.ycombinator.com/item?id=38804431 - Dec 2023 (2
| comments)
|
| _Typst - Compose Papers Faster_ -
| https://news.ycombinator.com/item?id=38354422 - Nov 2023 (134
| comments)
|
| _I rewrote my CV in Typst and I 'll never look back_ -
| https://news.ycombinator.com/item?id=38047224 - Oct 2023 (25
| comments)
|
| _typst-conceal.vim: cute UTF-8 conceal for typst_ -
| https://news.ycombinator.com/item?id=37862666 - Oct 2023 (1
| comment)
|
| _Typst 0.7: floating content, improved SVG support and better
| math layout_ - https://news.ycombinator.com/item?id=37038708 -
| Aug 2023 (1 comment)
|
| _Typst: Finally a Solid LaTeX Alternative_ -
| https://news.ycombinator.com/item?id=35835703 - May 2023 (3
| comments)
|
| _Typst starts its public beta test and goes open source_ -
| https://news.ycombinator.com/item?id=35364822 - March 2023 (1
| comment)
|
| _Typst, a new markup-based typesetting system, is now open
| source_ - https://news.ycombinator.com/item?id=35250210 - March
| 2023 (146 comments)
|
| _Typst: A Programmable Markup Language for Typesetting [pdf]_
| - https://news.ycombinator.com/item?id=34423590 - Jan 2023 (53
| comments)
|
| _What If LaTeX Had Instant Preview?_ -
| https://news.ycombinator.com/item?id=33222356 - Oct 2022 (23
| comments)
|
| _Typst: Compose Papers Faster_ -
| https://news.ycombinator.com/item?id=32209794 - July 2022 (30
| comments)
|
| _Typst: Compose Papers Faster_ -
| https://news.ycombinator.com/item?id=32205005 - July 2022 (1
| comment)
| pseingatl wrote:
| Does Typst have epub or html export?
| njkleiner wrote:
| Both are on the roadmap, apparently.
|
| https://github.com/typst/typst/issues/188#issuecomment-14933...
| vslavkin wrote:
| I've been looking into it. It's `blazingly fast` (aside from the
| rust joke, it really is way faster than latex), the syntax is
| more "modern", consistent, etc.
|
| The main problem is the popularity. It just does not have enough
| packages, at least for my use case.
|
| I mainly do a lot of equations (simple math), and a loooot of
| tikz (forest, circuitikz, pgfplots, etc.)
| [https://gitlab.com/vslavkin/escuela/-/tree/main/5to?ref_type...]
| I'm not a fan of tikz, but it's the only way to mantain the
| graphics homogeneous, clean, easily editable, compiled with the
| document and with links/references. Cetz (the typst alternative)
| is years behind. I've been thinking of contributing, but tikz is
| really complex, and I don't have enough time ATM.
|
| Besides the typst packages, it also lacks the editor packages. I
| am an emacs user _insert joke here_ , and I use AucTeX, which is
| a really great, and gigant package to edit latex (+cdlatex).
| AFAIK there's nothing like it for typst, which makes me way
| slower.
|
| Another thing is that they changed the math syntax. While the
| latex one wasn't perfect it was insanely popular, because of its
| use on markdown and a lot of pages (and this was thanks to
| mathjax iirc).
|
| The good thing is that something like latex or typst will always
| be needed, so there'll always people that want to have something
| like it; latex/tex isn't really great, and it has a really low
| entry bar.
|
| Maybe I'll switch when I have more time to study it and make
| packages. (It could be as soon as next year or a late as...
| never)
| YmiYugy wrote:
| In the very limited time I used typst it has been pretty amazing,
| but imho there is one missing feature that a LaTeX successor, but
| even more so, templating engine should have. Come up or adapt a
| format, that can defer certain styling decisions to the consumer
| of the document. Stuff like, font, font size, line spacing,
| citation style, double or single column, numeration style, etc.
|
| On a different note, we got to find a better way to exchange data
| than pdf reports. In my totally made up estimation about 10% of
| development time for enterprise software is spend on variations
| of these pdf templating tools and another 20% on extracting data
| from such generated pdfs.
| viralsink wrote:
| I like Typst, but I've had a couple issues so far:
|
| 1. The line spacing. It's not defined as baseline to baseline,
| but as the space inbetween two lines of text. Very difficult for
| an assignment with a prescribed line height since it usually
| refers to a baseline-baseline measure. 2. While having multiple
| columns is really easy, adding floating elements for the text to
| wrap around seems not possible. There's a reason all these CV
| templates have the info bar on the right instead of the left.
___________________________________________________________________
(page generated 2024-10-12 23:00 UTC)