Remix.run Logo
commandersaki 12 hours ago

These are some notes I wrote when I started out with typst when comparing with LaTeX:

1. It doesn't generate 5 bloody files when compiling.

2. Compiling is instant.

3. Diagnostics are way easier to understand (sort of like Rust compiler suggestion style).

4. List items can be either - item1 - item2, etc. or [item1], [item2]. The latter is way better because you can use anchoring to match on the braces (like "%" in vim), which means navigating long item entries is much easier.

5. In latex you have the \document{...} where you can't specify macros so they need to be at the top, in Typst you can specify the macros close to where you need them.

6. It's easier to version control and diff, especially if you use semantic line breaks.

7. Changing page layout, margins, spacing between things, etc., footers with page counters, etc. just seems way easier to do.

josephg 12 hours ago | parent | next [-]

8. Programming with it is lovely. Its got a little interpreted language built in, with helper functions like json("some_file.json"). I wrote a paper in it, and used that extensively to populate all my result tables. (Benchmark script -> JSON files -> typst compiled the results directly into the PDF).

TRiG_Ireland 10 hours ago | parent | next [-]

I've said that in Typst, when you're writing, it feels like writing, and when you're programming, it feels like programming. Whereas LaTeX always feels almost, but not quite, entirely unlike programming.

wasabi991011 4 hours ago | parent | next [-]

Nice Hitchhiker's Guide to the Galaxy reference! That's my favourite quote from it :)

For others, here's the quote being referenced:

> After a fairly shaky start to the day, Arthur's mind was beginning to reassemble itself from the shellshocked fragments the previous day had left him with. He had found a Nutri-­‐Matic machine which had provided him with a plastic cup filled with a liquid that was almost, but not quite, entirely unlike tea. The way it functioned was very interesting. When the Drink button was pressed it made an instant but highly detailed examination of the subject's taste buds, a spectroscopic analysis of the subject's metabolism and then sent tiny experimental signals down the neural pathways to the taste centres of the subject's brain to see what was likely to go down well. However, no one knew quite why it did this because it invariably delivered a cupful of liquid that was almost, but not quite, entirely unlike tea.

foobarian 5 hours ago | parent | prev [-]

The primary feeling I get from using LaTeX is: fear. Any little special thing I adjust tends to break the document, or move figures, or fixing one thing breaks another and so on. And forget about changing templates.

tentahedronic 14 minutes ago | parent | next [-]

My general advice here for you and many others in this thread would be to switch to Context (or even Luametatex if you really want to make some truly crazy stuff, basically it's just a newer and more experimental version of Context) if you are not happy with things and like to do your own customizations and don't bother becoming a TeX wizard. Latex is super if you are fine with the template you are provided or you absolutely need some obscurish package, otherwise Context is similar enough and bending it to your will is pretty much how it's supposed to be used.

3eb7988a1663 3 hours ago | parent | prev [-]

My paranoid workflow is that I have to make many subdivisions of the document so that I can trivially enable/disable components when I am triaging a problem. When something breaks, I am less reliant on the garbage error messages.

So the top-level document is just a long list of inputs

  \input{intro}
  \input{prelude}
  \input{complex_figure1}
  ...
The side benefit is that I can disable all but the component on which I am directly working, so compilation is faster.
kzrdude 12 hours ago | parent | prev | next [-]

The fast preview makes it a fun environment for interactive graphical/visual programming. With some limitations, unfortunately no animations and don't try to create thousands of objects or curves, the language server will run out of memory and have to be restarted.

repeekad 11 hours ago | parent [-]

Is what you’re describing something that latex handles well? I’m no expert, but that problem seems solvable by rendering previews with say sampling of large or complex objects vs full builds that maybe take a minute if high fidelity animations or very large graphs are desired as a supported use case in something fully open source

lupire 10 hours ago | parent [-]

LaTeX comping/rendering is generally extremely slow.

yodaDrofnats 3 hours ago | parent [-]

TeX is slow?!

Writing and editing an entire book manuscript is slow.

For pesky TeX chaos smashups, you create a small dedicated TeX file with necessary driver files, edit-compile-loop till satisfied.

Twenty years ago I ran a makefile producing 1755 pages on a 32 bit INTeL CPU. This was just to see what a fat book would look like, thousands of edits remained, still remain. All the two-column formatting was fine, except for problems of long equations and tables blowing up beyond the column, and other mess I couldn't solve. The compile run time was insignificant.

BTW its laTeX not LaTeX.

Donald Knuth's original creation will ever be infinitely more significant than the sprawling ocean of all the crumpled paper bag shenanigans Leslie and whomever-ephemeral else, RUSTy-paper-clips to the side.

De Laude Scriptorum

3eb7988a1663 3 hours ago | parent | prev | next [-]

Oooh that is nice. I have long relied on various conversion hacks to update data tables (mostly settled on pandoc markdown), but that little usability nugget is worth quite a bit to me.

phi-go 9 hours ago | parent | prev | next [-]

As you wrote a paper, how difficult would you say is it to recreate the template of the venue you submitted to?

colelyman 7 hours ago | parent [-]

I haven’t explicitly recreated a template for an academic venue, but I have recreated a custom template to match and existing PDF. It was pretty straightforward to recreate it as the language and “standard library” (if you could call it that?) is well designed and has excellent documentation.

red_trumpet 12 hours ago | parent | prev [-]

Have you compared this to using lua in lualatex?

gucci-on-fleek 10 hours ago | parent | prev | next [-]

> 5. In latex you have the \document{...} where you can't specify macros so they need to be at the top, in Typst you can specify the macros close to where you need them.

You can define macros anywhere you want, but you can only load packages in the preamble (before \begin{document}). I'm not familiar with Typst, but I would assume that it also requires you to load packages at the top of the document (or at least that's the only place that you would want to load packages).

> 6. It's easier to version control and diff, especially if you use semantic line breaks.

Semantic line breaks should be totally fine with LaTeX too.

> 2. Compiling is instant.

> 3. Diagnostics are way easier to understand (sort of like Rust compiler suggestion style).

Agreed, these are definitely LaTeX's biggest weaknesses.

mastermage 5 hours ago | parent [-]

I am 95% sure that you can import wherever you want. I remember doing it with Tables i defined in an extra document and then imported only where i actually needed them.

gignico 12 hours ago | parent | prev | next [-]

Actually number 5 is not an issue. Defining macros in the preamble is a custom but you can define macros anywhere.

toxik 12 hours ago | parent | prev | next [-]

Have you tried actually writing an article with it? I had very limited success. And since nobody is using it really, you're kind of on your own.

commandersaki 12 hours ago | parent [-]

Nah, just work documents (built in CI), resume, legal documents, ad-hoc documents. Publishing is not really in my purview.

throwaway_7274 8 hours ago | parent | prev | next [-]

Actually, you can’t specify macros anywhere. Unlike TeX, it’s a real honest-to-goodness programming language with functions and types and modules (yes! It has namespaces!) instead of just macros on macros on macros.

It’s not perfect, they definitely made some interesting choices here and there, but this makes it ~80% less painful than TeX when you’re doing anything other than happy-path undergrad-lab-report writing.

(To be clear, I know you know this! I’m writing this for the benefit of all sentient beings :))

baby 7 hours ago | parent | prev | next [-]

Oh wow, I was hopping something would come along with better friendlier errors like modern programming languages

porridgeraisin 8 hours ago | parent | prev [-]

> 5 bloody files

For those that have to use latex for various reasons, but absolutely hate these files from intermediate compiler passes, here are two aliases from my .bashrc

  latexloop() { latexmk -pdf -pvc -emulate-aux-dir -aux-directory=/tmp/latexcrap "$@"; }

  alias latexmk='latexmk -pdf -emulate-aux-dir -aux-directory=/tmp/latexcrap'
You can now `latexmk file.tex` and it will put all the auxiliary files in /tmp/latexcrap.

The `latexloop file.tex` invocation is just a helper that hot-reloads when you save the tex file.