Live data from Hacker News

Exploring Typst, a new typesetting system similar to LaTeX

blog.jreyesr.com

191–200 of 243 posts

Re: Exploring Typst, a new typesetting system similar to LaTeX

#191

Slightly offtopic: many commenters lament that latex is slow. I switched to https://tectonic-typesetting.github.io/en-US/ which is very fast and have better error reporting.

FWIW, 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.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#192
post #55

Earlier quoted context omitted.

> Besides the typst packages, it also lacks the editor packages. I am an emacs user… The typst editor plugin for vscode is pretty great. It gives you a split view of source & pdf, and you can cmd+click on either side to scroll to the corresponding source / rendered output. It also does things like give you autocomplete on fields from externally referenced json data. Obviously, that might be no help if you’re married…

I don't know which of the several typists plugins are you talking about, but they all seem decent, but years from achieving the features auctex has. Just to say, the most important features: Well, the feature you mentioned of clicking the PDF and redirecting to the source. Preview in the same buffer (window) as the code It uses other regexps to recognize the enabled packages, and then adds the package's macros and en…

The current actively-developed VSCode extension is Tinymist. Its workflow is great and addresses all your issues (to the extent they are even relevant to Typst):

> Well, the feature you mentioned of clicking the PDF and redirecting to the source.

Tinymist does this. Click on text and it redirects the document buffer to the corresponding source text.

> Preview in the same buffer (window) as the code

Tinymist previews in a separate tab for side-by-side real-time writing with a preview.

> It uses other regexps to recognize the enabled packages, and then adds the package's macros and environments to its list, so with a command you can open an environment or macro, and it recognizes which packages you are using, if you are in a math environment, etc. and shows only the ones you can use in the context. It's like a super-intelligent set of macros.

This sounds like an artifact of Tex. The standard Typst library is very thorough. And for everything else, Typst has automatic retrieval of community packages. Just add an #import and it just works:

    #import "@preview/example:0.1.0": add
    #add(2, 7)
> AucTex has also great support for bibtex/biblatex, and glossary/glossaries, both for using the macros and for compiling.

This just works with Typst in-the-box for bibliographies, and with the glossarium package for glossaries (just add with: #import "@preview/glossarium:0.4.2": *). But one thing a Typst IDE like Tinymist or the web service adds to the writing environment is an autocomplete for labels and citations. Just start typing the reference and get autocomplete options.

> Automatic, intelligent, labeling.

Not sure what this means, but you can add a label to headings, figures, etc. and quickly reference them with @label, and the current IDEs

Re: Exploring Typst, a new typesetting system similar to LaTeX

#193

C-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.

Speed 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 inf…

> 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

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

Re: Exploring Typst, a new typesetting system similar to LaTeX

#194

I'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…

Ooh, very interesting! I produce lots of reports using Jupyter and nbconvert. I have a custom nbconvert template (which uses pandoc+jinja+latex under the hood). I find the whole system to be a bit house-of-cards and I’d love to try alternatives. What’s your workflow for using Typst with Jupyter?

I've always bike shedded my own solutions because none of the existing tools did what I needed for physical books.

Pandoc does a decent job with connecting markdown to Typst. I have a few filters that I run to convert the notebook to markdown and some other filters that I run to change the output from Pandoc.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#195

I'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…

If you're talking about weak widow/orphan support for headings in particular, that will finally be fixed in Typst 0.12.

Great news!

Re: Exploring Typst, a new typesetting system similar to LaTeX

#196
post #82

References 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/ use an inline reference that wouldn't work in Serbian. Serbian (and many other languages) have suffix declensions, so while "Figure 4" is "…

Embedding words like Figure or Section breaks not only declensions, but capitalization, too. Germans won't notice it because all their nouns are capitalized, and English speakers won't care because they're traditionally forgiving with unmotivated upper-case words in the middle of a sentence (including titles). But formally it shoud be "Figure 4" in the caption and "as we see in figure 4" in the reference.

"as we see in figure 4" is simply incorrect, though; expressions such as "Figure 4" or "3rd Street" are treated as proper names and must be capitalised, as would the non-nominal "third" in "Dritte Straße" if any German-speaking city were to have American-style numbered streets.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#197
What 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.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#198

Earlier quoted context omitted.

I don't know which of the several typists plugins are you talking about, but they all seem decent, but years from achieving the features auctex has. Just to say, the most important features: Well, the feature you mentioned of clicking the PDF and redirecting to the source. Preview in the same buffer (window) as the code It uses other regexps to recognize the enabled packages, and then adds the package's macros and en…

The current actively-developed VSCode extension is Tinymist. Its workflow is great and addresses all your issues (to the extent they are even relevant to Typst): > Well, the feature you mentioned of clicking the PDF and redirecting to the source. Tinymist does this. Click on text and it redirects the document buffer to the corresponding source text. > Preview in the same buffer (window) as the code Tinymist previews…

It seems good, and there's an emacs version, altough simpler than auctex.

Not having the preview in the code buffer, isn't a dealbreaker, especially when typst is so fast, but it's still a useful feature.

The part of the packages I wasn't talking about a tex feature but an emacs one. When you import a package, it'll usually add environments or macros (in typst i believe they are called commands). Emacs would recognize thay you imported a package and with a shortcut you are able to quickly insert a command without writing it manually (because that's too much time... Like a template) It also recognizes the document type for inserting sections, and whether you are or not inside a math environment.

Albeit, looking a bit more in typst I think it's as mandatory as in latex. Commands tend to be simpler and shorter, especially sections. So maybe it wouldn't impact as hard as I had thought.

For references, using bib files, it would be almost as good as latex.

The auto labeling is useful for align envs or itemizes. AucTeX adds a label to each item or equation automatically. Again, not a dealbreaker, but would be great.

Reading a bit more, it seems that typst is a bit more different that what I had thought. I will not switch till cetz is more mature or I find another alternative.

Maybe I'll remake my Cv in typst just to try it out (+ my cv is horrible)

Re: Exploring Typst, a new typesetting system similar to LaTeX

#199
post #190

I'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_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://g…

In 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/lq9u...

Re: Exploring Typst, a new typesetting system similar to LaTeX

#200

In 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 bre…

I think you're looking for Quarto. Quarto can also compile to Typst for typesetting, but you can get simultaneous HTML/PDF/Word outputs from a single markdown input.
Post reply on HN