20 ms·
Exploring Typst, a new typesetting system similar to LaTeX
- bitwize 2y agoAh, Typst -- the Wayland of formatting systems.
- hyperbrainer 2y agoWayland is far more feature-complete than Typst is. Typst is Wayland 5-6 years ago maybe.
- alphazard 2y agoThis 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 2y agoCould 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 2y agoWell 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 2y agoIs your template/source available by chance?
- huijzer 2y agoYes at https://github.com/rikhuijzer/phd-thesis https://github.com/rikhuijzer/phd-thesis
- com 2y agoGreat thesis on an interesting topic. I’m always a fan of good model explainability. What did you use to generate the attractive and clear svgs?
- huijzer 2y agoThank you for the kind words. The plots were all created with Makie.jl [1] and lots of fiddling and manually writing code to get things right. Although I think Makie is great, I guess it would also be possible with other plotting libraries. [1]: https://docs.makie.org/stable/ https://docs.makie.org/stable/
- llm_trw 2y agoMarkdown 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 2y agoI'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_How_do_TeX_macros_actually_work%3F https://www.overleaf.com/learn/latex/A_six-part_series%3A_Ho... [1]: https://en.wikipedia.org/wiki/Church_encoding https://en.wikipedia.org/wiki/Church_encoding [2]: https://news.ycombinator.com/item?id=29713270 https://news.ycombinator.com/item?id=29713270
- Animats 2y ago> 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 2y agoStrange 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
- smartmic 2y agoThese 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.
- josephg 2y ago
- sshine 2y agoPlaces 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.
- josephg 2y agoI really wish typst had a good way to emit html. Id love to use it for blogging & technical writing and documentation.
- laurmaedje 2y ago(Typst dev here.) That's one of the next big things we plan to work on once Typst 0.12 has shipped. :)
- josephg 2y agoI can’t wait! Thankyou for all your work - I really appreciate what you’re building!
- gumbojuice 2y agoAre there journals/conferences that accept typst for typesetting yet? It is probably my main reason for staying in LaTeX.
- ykonstant 2y agoPerhaps you can use pandoc to turn Typst into Latex and then do the little dance of making it compatible with the provided headers? [ The latter is painful no matter what; once, I had a paper that I simply could not get to compile with the journal's header and had to give it to a wizard for examination. He did some manual TeX shenanigans resulting in a big blob of raw TeX at the preamble and it all worked. ]
- SkiFire13 2y agoPersonally, 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.
- __mharrison__ 2y agoI write markdown and use Pandoc (plus some filters) to create Typst. Happy to never touch LaTeX again.
- necovek 2y agoAs a side note, TeX engine could support Markdown or HTML or many other syntaxes too: it's easy to redefine control character in TeX to be anything instead or in addition to "\" (I've actually done that with Plain TeX a couple decades earlier to allow two-byte UTF-8 input by making all first-bytes of valid 2-byte UTF-8 sequences into control characters). So, LaTeX being "unergonomic" is only relative — it's pretty ergonomic compared to things like HTML but especially DocBook or TEI SGML/XML schemas, but less ergonomic than Markdown or even Plain TeX. However, it inherits the most complex part where it is extremely ergonomic from Plain TeX (for the most part): editing math formulae. But it's also much richer in expressing intent than any of those, and from what I can see, compared to Typst as well — LaTeX is basically semantic markup for excellent printed output (where Plain TeX is excellent printed output with no semantics, DocBook/TEI are pure semantic markup, and HTML/Markdown/Typst are somewhere in the middle too).
- vivekd 2y agoI'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 2y agoLove to hear some informed opinions on typst versus quarto.
- timeon 2y agoThere 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 2y agohttps://quarto.org/docs/output-formats/typst.html#raw-typst https://quarto.org/docs/output-formats/typst.html#raw-typst
- fourthark 2y agoYes, 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 2y agoSearch 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 2y agoBuilt 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 2y agoI 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 2y agoHave 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.
- thangalin 2y ago> Have you tried with ConTeXt? Have you taken a look at my text editor, KeenWrite? https://keenwrite.com/screenshots.html https://keenwrite.com/screenshots.html The text processing chain for KeenWrite is: Markdown (input) -> XHTML (export) -> ConTeXt (import) -> PDF (output) The look and feel of the final PDF document is controlled by a theme, which allows complete customization.
- cbolton 2y agoDo give typst's syntax a try! I had the same worry as you but I now find typst's syntax more pleasant to write, and the resulting code is much more readable. Instead of \frac{1}{\alpha - 1}\ \mathrm{for}\ n\in\{1, \ldots, N\} you get to write 1/(alpha - 1) "for" n in {1, ..., N}
- elashri 2y agoPrevious discussions about Typst. https://news.ycombinator.com/item?id=41014941 https://news.ycombinator.com/item?id=41014941 https://news.ycombinator.com/item?id=38354422 https://news.ycombinator.com/item?id=38354422 https://news.ycombinator.com/item?id=38047224 https://news.ycombinator.com/item?id=38047224 https://news.ycombinator.com/item?id=35250210 https://news.ycombinator.com/item?id=35250210 https://news.ycombinator.com/item?id=34423590 https://news.ycombinator.com/item?id=34423590
- dang 2y agoThanks! Macroexpanded: Typst: An easy to learn alternative for LaTex - https://news.ycombinator.com/item?id=41014941 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 https://news.ycombinator.com/item?id=40986352 - July 2024 (1 comment) No-Signup Typst Tools - https://news.ycombinator.com/item?id=40905678 https://news.ycombinator.com/item?id=40905678 - July 2024 (1 comment) Typst Symbol Classifier - https://news.ycombinator.com/item?id=39878069 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 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 https://news.ycombinator.com/item?id=38804431 - Dec 2023 (2 comments) Typst – Compose Papers Faster - https://news.ycombinator.com/item?id=38354422 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 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 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 https://news.ycombinator.com/item?id=37038708 - Aug 2023 (1 comment) Typst: Finally a Solid LaTeX Alternative - https://news.ycombinator.com/item?id=35835703 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 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 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 https://news.ycombinator.com/item?id=34423590 - Jan 2023 (53 comments) What If LaTeX Had Instant Preview? - https://news.ycombinator.com/item?id=33222356 https://news.ycombinator.com/item?id=33222356 - Oct 2022 (23 comments) Typst: Compose Papers Faster - https://news.ycombinator.com/item?id=32209794 https://news.ycombinator.com/item?id=32209794 - July 2022 (30 comments) Typst: Compose Papers Faster - https://news.ycombinator.com/item?id=32205005 https://news.ycombinator.com/item?id=32205005 - July 2022 (1 comment)
- pseingatl 2y agoDoes Typst have epub or html export?
- njkleiner 2y agoBoth are on the roadmap, apparently. https://github.com/typst/typst/issues/188#issuecomment-1493319013 https://github.com/typst/typst/issues/188#issuecomment-14933...
- CJefferson 2y agoBoth have been “on the roadmap” from day 1, with little progress. Many open source projects put “we should make our system accessible to disabled vision issues” on the roadmap, depressingly few projects then actually do it. Even latex, which in academic circles is famous for not having html output, nowadays produces more accessible output than typist.
- Vallaaaris 2y agoYou are right that it's been on the roadmap for a while, however, it's definitely very high on their priority list. The recent update (v0.12) contained a lot of necessary internal refactorings of the layout engine, and they've mentioned on the Discord that after v0.12, they will start work on HTML output.
- CJefferson 2y agoI really hope so, and I will start recommending typst when there is good accessible output. However, it’s also been a “top priority” since basically the first release.
- samatman 2y agoThe issue is a bit more than a year old. Feel free to step up and close it. Complaining about it isn't going to add velocity to a new project.
- vslavkin 2y agoI'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=heads 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)
- sourcepluck 2y ago> I use AucTeX, which is a really great, and gigant package to edit latex (+cdlatex) This is tangential, but have you any quick tips for someone looking to get started with AucTeX? I'm a comfortable Emacser who has started to occasionally think of some document I'd like to do in LaTeX (some maths questions for a student, or an overview of some topic). I've looked at AucTeX once or twice, and ran away thinking, oh, I'll do that some other time. What is the order of events? Should I make a few really basic LaTeX documents first with a terminal, and then try AucTeX?
- fiddlerwoaroof 2y agoI’ve found that the best way to learn a new emacs package is incrementally: for something like Auctex, I initially just enable it for my latex documents and then I configure and learn features as I need them, never learning too much at once. Even with minimal configuration, it gives you some nice things like imenu entries for headings and a menu that surfaces some of the basic latex feature
- YmiYugy 2y agoIn 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.
- mixmastamyk 2y agoThat’s what html was supposed to be; probably still could. Epub uses it as well, though readers are not equivalent.
- justinpombrio 2y agoYou can do that in a couple different ways in Typst. First, if the user passes content into the template, then it's the user's content that ultimately gets to choose its styling. That is, there are three places that a style can be set: 1. In the content passed that the user passes to the template 2. In the template itself 3. By the user, outside the template They take priority in that order. OTOH, if the template really wants control, it can take optional styling arguments with defaults, and do as it likes with them. And if it wants content from the user that the user doesn't get to style, it can take that content as a string. It's a fantastic system, so far as I've seen.
- paholg 2y agoI think they were saying they want a format instead of PDF where the reader can change those things.
- BoingBoomTschak 2y agoThat was exactly my reaction after stumbling upon https://typst.app/universe/package/modern-cv/ https://typst.app/universe/package/modern-cv/ I just want a replacement for ModernCV, not downloading MBs of fonts I don't want to use.
- viralsink 2y agoI 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.
- Aaron2222 2y agoYou can change how the bounding box Typst uses for layout is defined (i.e. set the top and bottom edges both to the baseline), then I would imagine the spacing would be baseline to baseline. Would need to adjust the space before a paragraph to compensate though.
- suvadivian 2y agohttps://github.com/typst/typst/issues/4224 https://github.com/typst/typst/issues/4224 This issue and others like it are dealbreakers for me. There are numerous related issues, but the developers are stubbornly sticking to their interpretation—using the older definition of leading from the days of metal type, rather than the more modern concept of line-spacing. No other software or modern typesetting system I know of uses this approach anymore. This is particularly frustrating since I work with a lot of multilingual text, including Arabic, and it's very difficult to align the baselines when setting text in more than one column.
- viralsink 2y agoI gotta say though, Typst is powerful enough to implement a custom line spacing. Using the measure command you can get the height of the current font and use that to automatically convert. It's just cumbersome.
- laurmaedje 2y agoAs one of the core developers, I would say "stubbornly sticking to their interpretation" is not entirely fair. I am open to changing this, but I don't want to do it hastily --- because that means changing things twice. Figuring out all the correct behaviours, in particular with equations and inline objects, is challenging. I tried to constructively present some arguments in favor and against the proposed changes in the linked issue, but I simply did not have time to push things forward beyond that myself so far.
- moelf 2y agothe current show-stopper issue is that Typst can't insert PDF as figure[1], this makes a lot of scientific publication workflow impossible. [1]: https://github.com/typst/typst/issues/145 https://github.com/typst/typst/issues/145
- me_jumper 2y agoI thought about trying it. This just killed it for me...
- xkevio 2y agoIt's a somewhat difficult issue and I understand being hesitant because of this. Converting to SVG is one possible path around it which isn't too bad but having it natively is of course even better. The thing is, inserting PDF for just the PDF export would be quite easy. The issue is the other export targets Typst supports (SVG and PNG) as that would require some form of rasterization / a full blown PDF engine written in Rust without C-bindings because of the web app and that simply does not exist yet. And the developers are hesitant to just add features for one specific export target which I get.
- __mharrison__ 2y agoI've moved all of my LaTeX-based content creation to Typst. It's: - Fast—Compiling my books would take around 1 minute (I often had to compile twice due to indexing). With Typst, it takes less than 5 seconds. - Easy to write—I actually don't write it, I wrote a bunch of Pandoc plugins to tweak the output from Pandoc (I write all my books in Jupyter these days, so lots of markdown). - Easy to read—I've used LaTeX for years (and wrote a bunch of tooling around it) and still couldn't tell you when to use a { or a [. Typst is very readable. - Easy to script—Okay, I did write some Typst the other day. I migrated my LaTeX-based invoicing system to Typst. I created a list of objects with pricing and count and was able to throw it into a table easily. It has less code than my LaTeX version, which was using a library, and is easier to read. (I did need to write a function to properly format $ because that doesn't exist. A few rounds with AI made that easy.) - Has great error messages—If you've used LaTeX, you know what I mean. My needs are different from others, but I'm writing PDFs that need to be printed into a real book that looks professional. This includes front matter, footnotes, callouts, page numbers, page headers and footers, and indexes. I don't do a lot of math-heavy stuff, so I can't comment on that. And the widow/orphan support is a little weak. Otherwise, I'm happy to never use LaTeX again!
- akoboldfrying 2y agoWith your experience of both, have you found that Typst has fewer issues with conflicting/non-commutative plugins than LaTeX does? Because that's where I lose the most time with LaTeX: packages often mess with the (piles of) global state in ways that sometimes conflict, and the only "solution" seems to be that, if you're very lucky, sometimes conscientious package authors will try to "detect" (through various hacks) whether some other known-conflicting package has already been loaded and adjust accordingly. I didn't see any mention in TFA of any module system or even local variables in Typst to contain this explosion of complexity, so I suspect it will be just as bad in this respect as LaTeX is once there are as many plugins available.
- __mharrison__ 2y agoTo be honest, I don't know if I've seen conflicting packages. Do you have specific examples?
- mbo 2y agoFirst of all, I will commend the Typst community for attempting to rectify the trainwreck that is LaTeX typesetting. It appears that they have succeeded. So Typst has its own styling system, and its own scripting system, and plugin system via WASM... isn't this just HTML with extra steps? Not to mention that Typst doesn't support HTML export https://github.com/typst/typst/issues/188#issuecomment-1493319013 https://github.com/typst/typst/issues/188#issuecomment-14933..., which is a major impediment to vision-impaired accessibility in the academic community. I think this is all a bit of a shame that there's been no major efforts to reform HTML as the go-to file format for scientific publishing instead. All the elements are there - <cite>, citation.js, KaTex, Web Components, good plotting libraries (Observable Plot), WASM. Was all this extra engineering effort required to get us a Markdown style syntax? I know people hate XML-based markup... but it's not _that_ bad, right?
- Onavo 2y agoThe key difference between print systems and web tech is responsiveness. Anything print related is primarily designed with dead tree format in mind, so the layout won't change, and you don't have to worry about text reflowing after editing. It's also why LaTeX/PDF to HTML converters are so difficult to build, because the underlying engine has no semantic information about the structure (this may be changing with LLMs and multimodal setups).
- aniviacat 2y agoOne could ask if responsiveness is relevant for documents. You could simply use a static layout for your html, and then add borders or zoom (just like in a pdf viewer). Then you'd have the editability, accessibility and performance of html, with the same responsiveness as a pdf (none). I've never really given this much thought, but html could reallly become the standard file format for documents.
- mbo 2y ago> The key difference between print systems and web tech is responsiveness. True, but... we were very good at building unresponsive websites in the early 2000s. Can't we just return to tradition and disable a lot of the responsive behaviour that we've layered onto HTML with an off-the-shelf stylesheet? Hardcode some width properties, ya know? (This is not a rhetorical question, genuinely curious).
- quotemstr 2y agoC-f r u s t RET But of course. I'd rather see effort go into improving LaTeX performance instead of creating some new incompatible thing in a trendy language. One could also imagine an Elixer-style "resyntaxing" of LaTeX that would preserve compatibility with decades of packages. I don't think a long-developed ecosystem should be given up lightly.
- lapinot 2y agoSpeed and nice error messages in (La)TeX, and to some extent ease of programming, are entirely doomed because of fundamental design choices. Being based on unhygienic macro expansion means that there is only one way to evaluate (the slow way), there will never be incremental compilation (everything can possibly be stateful in horrible ways), there will never be good error messages because there's basically no AST information anywhere (begin/end is a joke). Regarding ecosystem: tons of undecipherable LaTeX packages are basically one-liners (ok, 10 liners) in typst. I know it from experience: I've written my PhD manuscript in typst. So perhaps one reason why there are so many (basically frozen) packages in LaTeX is because they are so hard to write and maintain. edit: of course, being only a few years old, typst is nowhere near as solid as TeX, but you can already use it for a lot of things and its a breeze to use.
- thangalin 2y ago> Speed and nice error messages in (La)TeX are entirely doomed because of fundamental design choices. Have you checked out KeenType? https://gitlab.com/DaveJarvis/KeenType https://gitlab.com/DaveJarvis/KeenType It's a Java-based implementation of TeX, forked from NTS, that was optimized to render 500 to 1,000 equations in real-time on commodity hardware. My text editor, KeenWrite, uses the KeenType library to preview the document. The final output is passed to ConTeXt for typesetting, by way of first converting Markdown to an XHTML file. (This means that KeenWrite can export as both HTML and PDF.) https://keenwrite.com/screenshots.html https://keenwrite.com/screenshots.html
- quotemstr 2y agoAST information, hygienic macros, and a ton of other things can be added without starting over. What do you think of LuaTeX? I think we as an industry habitually overestimate the difficulty of evolving older platforms and underestimate the value of doing so.
- beezle 2y agoReal men use TeX or troff!
- volemo 2y agoReal men write formulae by hand in their typewriter typed papers.
- cozzyd 2y agoUntil the arxiv gets typst support, I imagine this will get relatively little traction.
- aragilar 2y agoThe two baseline criteria I have for better-than-LaTeX options are: 1. Maths support equal to or better than amsmath 2. LaTeX-style macros Both are needed to make writing large amounts of complex equations acceptable. There should also be something similar to unicode-math, cleveref and biblatex, easy-to-use options to control layout/style/output (including metadata).
- josephg 2y agoI wrote a recent paper in typst. We ended up converting it to latex at the last minute to work with the conference’s submission guidelines, and work around a small bug (now fixed) in typst. But I would 100% use typst again. I wish it output html so I could use it for blogs & documentation. The maths support was more than good enough for what we needed, and I enjoyed writing it a lot more than latex maths. The macro-equivalent support in typst is fantastic. It’s a standout feature. It has a full, modern-feeling programming language built in, complete with modules, functions, variables, arrays, the whole works. And there’s a growing ecosystem of 3rd party packages you can use with typst. Our benchmark scripts output the results into json files. Then when the typst document compiled, our typst source pulled in the benchmarking data directly from those json files. Then it used that data to populate tables and render charts directly, straight into the pdf. It was a lovely way to work. (Though that said, I ended up swapping to a more fully featured external charting library because the charts it created looked better).
- aragilar 2y agoLaTeX maths or amsmath maths? TeX maths != LaTeX maths != amsmaths maths, and usually what I see described as "LaTeX maths" is TeX maths (or a subset, when someone claiming "LaTeX support" but not actually using LaTeX). I'm not interested in a programming language (though naturally being able to write plugins would be useful ala luatex), but a textual macro system. I have things like (which is one of the simpler macros): \newcommand{\dt}[1]{\frac{∂#1}{∂t}} so I can write things quickly and efficiently. That is the power of (La)TeX, and most examples I've seen of LaTeX alternatives seem to miss that use case, and instead focus on other things (e.g. HTML generation, alternate programming languages).
- mixmastamyk 2y agoDoes this allow a book to be split into parts? One problem I had with Sphinx.
- zamazan4ik 2y agoFor anyone who is interested in speeding up Typst, I can recommend taking a look at this issue: https://github.com/typst/typst/issues/1733 https://github.com/typst/typst/issues/1733 TL;DR - Profile-Guided Optimization (PGO) can improve Typst's performance for 10%+
- knuckleheads 2y agoTypst is a lot of fun and lets you do some really cool stuff. However! In the process of doing that cool stuff, you may need to debug things and that’s when it’s no longer fun. There is no way to print anything out to console and debug anything about what is going on. People have asked for it for over a year now and the authors have refused/ignored their requests. I would be using it a lot more except for this. https://github.com/typst/typst/issues/1669 https://github.com/typst/typst/issues/1669
- cbolton 2y agoThe author of this issue is the main developer so I guess they want it done, just had other priorities. I agree typst needs better debugging tools, but you're a bit harsh. It has things like `repr` that can often be used to inspect objects, and `panic` can be used as a (admittedly crappy) substitute for printing a value to the console.
- knuckleheads 2y agoWould you prefer that I not say exactly why I am not using typst right now as I would like to? The debugging experience is jarring compared to everything else and it put me off. I'd like to be using it but for the things that I want to do, I need to be able to figure out the mistakes I was making faster and easier.
- cbolton 2y agoMaybe I was a bit harsh too :) I don't think the debugging experience is worse than in LaTeX (a low bar admittedly): you can print to the console in LaTeX but it's drowned in other messages. Instead of grepping the console in practice I use \show\thing, which is basically the same as doing panic(thing) in typst. What I do is put commented-out "panic(variable)" here and there, and use the comment/uncomment shortcut in the editor to see the value of the variable. With typst's incremental compilation I get immediate feedback, so a better experience than in LaTeX.
- laurmaedje 2y ago
- necovek 2y agoReferences in established systems like LaTeX work the way they do for a reason: you don't want to embed words in them (like "Figure" or "Section") automatically because it does not work across languages. Eg. both the article and docs at https://typst.app/docs/reference/model/ref/ https://typst.app/docs/reference/model/ref/ use an inline reference that wouldn't work in Serbian. Serbian (and many other languages) have suffix declensions, so while "Figure 4" is "Slika 4", when used like "in Figure 4", you really need "u Slici 4" (and lowercase, really) instead of "u Slika 4" as produced by Typst. On the plus side, it seems to use OTF locl tables for substitution glyphs for language, though it only partially works for Serbian (might be due to bad locl tables for LinLibertine which seems to be the default font). I am sure it's not too hard to only get the reference number (eg. @foo.context.something?), but defaults should be good or maybe per-language? I can see how they wanted to avoid authors having to hard-code the reference type if they change eg. something from an image to a table, but it's hard to make it smart enough for any language.
- devit 2y agoSurely it could just insert the proper form depending on context? (with language-specific code of course)
- necovek 2y agoThat's what ChatGPT sometimes struggles to do correctly for Serbia : the rules are tricky and depend on the surrounding text. Eg. if you want to say "In figures 4 and 5", you are already struggling (even in English). So even embedding latest LLM won't solve it so it's better to leave it to the author to do the right thing.
- bboygravity 2y agoWhy would a user who types only in English prefer a system that was optimized for all languages?
- superb_dev 2y agoIt’s better for all of us if we can collaborate with a common system. This tool will have to deal with other languages if it’s gets popular enough
- dsrtslnd23 2y agois this comparable to asciidoc?
- riedel 2y agoFirst of all, today I almost exclusively write all my LateX in overleaf, so a lot of pain of LateX distros is taken away. But the main thing was always good templates, so I found a collection of ML conference templates [0], that shows also that typst still has some issues with acutely reproducing existing styles. Also when having to submit sources, I guess cross compile to latex would be the only possibility (typically they accept Latex or sometimes MS Word) [0] https://github.com/daskol/typst-templates https://github.com/daskol/typst-templates
- Munksgaard 2y agoI use typst to generate PDFs on the fly in my sass-platform. The only other reliable ways I could find to do that was by using LaTeX (slow) or various WebKit-based tools (also slow, and in carious states of unmaintained/deprecated). It works like a charm.
- enriquto 2y agoIt's cute that you can write greek letters by spelling them, without any escape: pi, alpha What I'd really want to type is however π, α Will this work in typst? I had some trouble installing it.
- cbolton 2y agoYes that works. What trouble did you have installing it? (It's literally a single binary with zero dependencies)
- enriquto 2y ago> Yes that works. Oh, that great! My major point of friction with LaTeX is that using unicode is not straightforward. You sort of can, by including the right packages and using the right interpreters, but it imposes strange constraints involving the fonts that you can use and whatnot. Regarding the usage, it's probably my fault. I tried to compile it locally and it didn't work at first (requires newer rustc version).
- jimhefferon 2y ago> My major point of friction with LaTeX is that using unicode is not straightforward. Possibly you are describing how it used to be before the input encoding standard for LaTeX switched to UTF-8?
- enriquto 2y agoNo. I'm talking about modern LaTeX. You can easily write é outside of math mode, but not inside. By default, you cannot write α either inside nor outside of math. By using the right packages, you can do both, but other things break.
- aragilar 2y agoWhich engine? I believe XeTeX and LuaTeX support it natively?
- divan 2y agoI'm using Markdown/LaTex to PDF/HTML converter for preparing various legal/rules documents. While this approach works for very simple documents, whenever I needed simple change (i.e. specific list numbering or break the page for chapters) the path to find the solution was long and painful. Typst was a breath of fresh air, and I'm moving all my document generators to it and don't look back. The only thing I miss at the moment is generation of HTML (in addition to PDF). It's possible to achieve via Typst+Pandoc I guess, but would be great to have it as an output target natively.
- hggigg 2y agoWhile I appreciate these projects, I can't see any headway for something like this in our academic community. We have a very established ecosystem of LaTeX packages, styles and documents, some of which are more than 25 years old. Everyone knows it. Everyone collaborates with LaTeX. Knowledge is easy to pass on because it is well understood. Everyone knows (or are) the people who write the packages or maintain things behind the scenes. This is all quietly boiling away without a single thing on GitHub. To move to Typst, we'd have to start again and build all that again, because I guarantee there's stuff you just can't do it in it. I mean I looked at the options for tikz. One publication we have has 520 tikz figures in it for example. And that's dead.
- cbolton 2y agoSure but you have to take into account how easier it is to build these things in typst. It's like one year since the first public typst release and someone already built a very functional "TikZ" equivalent called CeTZ. Far from being as mature as TikZ but easier to extend yourself.
- deleted 2y ago[deleted]
- Semaphor 2y agoIf the author is reading, there’s a bug with dark mode, the `aside` (for the TOC) gets a background color of #d3d3d3 which results in very bad contrast as the font and heading are adjusted for dark mode.
- HerrmannM 2y agoI have a love-hate relationship with LaTeX... in 2016, I wrote my PhD with it, for wich I defined lots of helpers and commands.I used xetex for some obscure reasons I don't remember.The final result was beautiful but I dread opening any of those files. And it doesnt compile anymore. Among all the systems (tools, languages, devices...) I exploited professinaly, LaTeX is the one that remains the most obscure and frustrating to me. I'm not sure why.
- tcfhgj 2y agoIt took me a few hours to be able to do things I could never do in Latex, which I have had used for a number of documents like thesis, project reports, etc. In Latex I always relied on googling random packages to fix weird stuff while in Typist I feel like I can do anything I want myself. The scripting capabilities are powerful and compared to latex insanely easy to use.
- lapinot 2y agoThis! My first actual project (besides some testing) has been my phd manuscript, and after ~2 days i actually had a tufte-style 1.5 column layout going, written from scratch. And its probably like ~250 lines. There are some rough edges still, the dom model and advanced programming stuff is not quite there yet (user-defined elements, user-defined settables, advanced layout like chaining blocks for laying text flows). But like the quality of the user interface is several orders of magnitude better than (La)TeX.
- rsrsrs86 2y agoTypst is simply amazing. I wrote a thesis using latex and boy would I love if I had found about typst sooner.
- seanhunter 2y agoI really want to like this because it seems a lot more accessible to folks than latex but I'm getting that "uncanny valley" feeling like when I look at equations that have been typeset in MS Word. They look almost, but not quite, good. Like if you look at the equation for Binet's closed form solution for Fibonacci numbers in the link below from their github, it looks to me like there is a bit too much space on either side of the plus sign in the equation for phi on the right hand side. And phi^n on the left-hand side looks too close to the 1/sqrt(5). https://user-images.githubusercontent.com/17899797/228031796-ced0e452-fcee-4ae9-92da-b9287764ff25.png https://user-images.githubusercontent.com/17899797/228031796...
- cbolton 2y agoI think you're imagining things... This spacing stuff is mostly defined in the font files and typst uses the same math font (or a more recent version, depending on your LaTeX config). I made a small comparison: https://imgur.com/a/0k6dsok https://imgur.com/a/0k6dsok Note that by default, typst uses the book weight from New Computer Modern. This corresponds to the default settings in LaTeX with the "fontsetup" package. The only difference I can see is the spacing after the comma. Not sure why typst does it differently. I think typst might be doing the right thing here actually, but it's easy to adjust if you want. My typst code: $ round(1 / sqrt(5) phi.alt^n), quad phi.alt = (1 + sqrt(5)) / 2 $ My LaTeX code: \[ \left\lfloor\frac{1}{\sqrt{5}} \phi^n\right\rceil,\quad \phi = \frac{1+\sqrt{5}}{2} \]
- seanhunter 2y agoThanks for doing the comparison but that just looks to me like I’m not imagining it. There’s more space around the plus sign with typst.
- cbolton 2y agoCould it be an illusion because the "zoom" is a bit different? (I was screenshotting different applications). Here's a better comparison: 11pt size for both, then importing the LaTeX output in typst (using SVG conversion since typst cannot import PDF): https://imgur.com/a/aZRx6fs https://imgur.com/a/aZRx6fs I removed the "comma" that produced different spacing, and added the missing F_n. It seems there's still some different in spacing due to the quad. If you still think the spacing around '+' is different you'll have to add some highlight/measurements or something to convince me, because they look quite identical to me...
- gxonatano 2y agoTypst is a huge improvement over LaTeX, but makes the rather anachronistic decision to target paper-based media instead of screens. Unless you're planning to print out all your papers onto physical paper, and you have stacks of different sized paper lying around (A4, US Letter, US Legal, etc.), PDFs are kind of old-fashioned. Why constrain your document's width to eight and half twelfths of the length of some medieval king's foot, when we have cutting-edge 1980s technology like HTML which can adapt to your screen width? Incidentally, there's an open issue with Typst for making HTML output, but I don't understand why that wasn't the project's first priority. Even if scientific journals require PDF uploads, you can still get those from printing HTML. The opposite isn't true at all.
- perlgeek 2y agoIn the near future, I'll have to program the document generation part of an invoicing system. In the past, I've done generated PDF documents through latex, and didn't really like the process (for one, escaping is just so weird in latex, \ to \textbackslash for example). I've thought about generating HTML and using a headless browser that can produce PDFs for me, but I don't know how well you can e.g. control page breaks with CSS these days. Maybe typst is actually a good alternative here? Does anybody have experience with typst and multi-page tables?
- bobbylarrybobby 2y agoI think css is fine at doing page breaks. https://developer.mozilla.org/en-US/docs/Web/CSS/break-before https://developer.mozilla.org/en-US/docs/Web/CSS/break-befor...
- wint3rmute 2y agoI'm doing PDF document generation in typst, the format I'm generating is similar to invoices (specific to how the law in my country is, but that's a longer story). Typst code generation was easy to automate with trivial python templates (jinja2). The core part of my document are multi-page tables, and typst splits them nicely. I had to google around a bit, as there are multiple settings on how large tables are handled, I suggest that you give Typst a try, you can build a working prototype in no time
- perlgeek 2y agoThanks! Are you using the json loading feature in typst at all?
- wint3rmute 2y agoNope, didnt event knew such a thing existed :)
- niklasei 2y agoI have been building tools for document generation out of templates using Typst for a few months. It works great! So far, I haven't found any bigger issues with multi-page tables in Typst. For example, it was no big deal, to get subtotals in an invoice for every page break.
- lynndotpy 2y agoI'd like to throw my two cents into the "my experience is limited but I like it better than LaTeX" ring. Because, in my limited experience, Typst is easier and faster than LaTeX by a lot. I'd like to emphasize how important it is that Typst is a collaborative web-app like Overleaf-- 100% of the LaTeX use I saw in academia was on Overleaf.
- tiffanyh 2y agoMy concern would be that this seems like such a niche market that only charging $8/month, raises long-term viability concerns. Last thing you want to do is use a platform that goes defunct. https://typst.app/pricing/ https://typst.app/pricing/
- nihzm 2y agoIf I understand correctly the fees are only for an overleaf-type web collaborative editing experience. The typst program itself, the one you install on your computer, is free to use and open-source.
- pcranaway 2y agoThat's right. The whole thing is open source -- just, since it's hard to make any money from open source, they made the online editor (which is pretty good BTW)
- vzaliva 2y agoSlightly offtopic: many commenters lament that latex is slow. I switched to https://tectonic-typesetting.github.io/en-US/ https://tectonic-typesetting.github.io/en-US/ which is very fast and have better error reporting.
- pcranaway 2y agoYup. I use both LaTeX and Typst (although I prefer Typst when possible) and I haven't used anything other than tectonic for the past few years. It simply has everything you need included, and is pretty darn fast too.
- ratmice 2y agoFWIW, as a long time user of tectonic I just started a project using typst yesterday, I'm really curious if typst will be able to do parallel downloading of packages than tectonic. This is something which I have found can affect initial first time document builds since it can cause sequential downloading of a lot of small files sequentially. The reason why it is difficult to parallelize or fix in tectonic itself is the way latex itself is parsed in a turing complete fashion. Importing a package can affect subsequent parsing. This makes it basically impossible to build a map of package dependencies without interpreting the entire document. I'm curious to see how typst handles such things.
- deleted 2y ago[deleted]
- lutusp 2y agoThe central issue for new typesetting methods, unlike most software projects, is that to represent a solution, not a new problem, they must seamlessly communicate with other similar environments. So I have to ask: * Can Typist seamlessly export Latex? * Can Typist seamlessly import Latex? And I must link to the definitive XKCD cartoon on this topic: "Standards" https://xkcd.com/927/ https://xkcd.com/927/ .
- daedac 2y agoI've been using Typst for a while. It's a joy to write in but currently has very limited scope. There's a good summary of its current limitations here https://www.reddit.com/r/typst/comments/1ej07al/why_i_use_latex_instead_of_typst https://www.reddit.com/r/typst/comments/1ej07al/why_i_use_la... . For me, it's basically a non-starter for academic work because it doesn't support PDF and EPS images (there are currently issues with SVG too). They also have no plans to support PDF graphics (https://github.com/typst/typst/issues/145 https://github.com/typst/typst/issues/145).
- thoroughburro 2y agoIn an update to that same thread, a comment claims most of those items are fixed in 0.12, in staging now. https://www.reddit.com/r/typst/comments/1ej07al/comment/lq9ugio/ https://www.reddit.com/r/typst/comments/1ej07al/comment/lq9u...
- ThinkBeat 2y agoWhat is the story with the fonts Typst uses? Does it come with a standard library of fonts? I am not a fan of LaTex myself, but I admire it to some extent. Other systems come along that are less verbose and easier to write, and faster. Yay. And then people use it, and then someone thinks "oh we should have this function", "We need to add a feature for it to work well" etc etc and slowly the system either bloats, and at some point, a person will look back at LaTeX and go "Oh that is why this existed, and ah that is why this is slow" Or one can choose to keep the new system simple and simply use LateX when something more is required.
- LectronPusher 2y agoAdding a font is just `#set text(font: "besley")` or you can use a list for fallback like `#set text(font: ("jost", "noto sans")`. Then you can select weight, italic/bold, opentype features, ligatures, etc. as options on `text` with the same syntax. You can see all the options for `text` here: https://typst.app/docs/reference/text/text https://typst.app/docs/reference/text/text It will likely need some reorganization in time, but is quite functional. The command line comes with a few defaults such as the open source Libertinus for text or New CMM for math, but may fall back to your System fonts for characters like emoji (and there are flags to disable system fonts). You can also set a specific path to look up font files. And then the web app has plenty of fonts in an extensive dropdown, and supports dropping in custom font files that will be automatically recognized. I believe one current limitation is bitmap fonts not working properly, but that is being actively developed by a contributor. I'm optimistic that Typst won't run into the issues you mention. I see it as doing well at incorporating the knowledge of the past into simpler, better interfaces.
- iamgopal 2y agoIs there typst based static docs generator out there ?
- poulpy123 2y agowow that's a really in-depth review, that's nice. I tried typst several months (or was it already a year?) ago, and I found it really great. I was even able to easily modify a simple plugin after barely playing 1 hr with it, where in latex that I used for years, I never even tried (to be fair the amount of plugins meant I didn't need to). I just wish I had a good reason to use it... maybe when the implement the html output ?
- puffybuf 2y agoLatex already has massive amounts of libraries. Simple things like chemistry or physics typesetting for example. That's hard to just switch away from. can it do freetype fonts? I use XeLatex to change the fonts since the default gets boring. I've been doing all my math in latex for so long I feel like I can't just switch to something else.