Live data from Hacker News

Typst: An easy to learn alternative for LaTex

github.com

131–140 of 192 posts

Re: Typst: An easy to learn alternative for LaTex

#131

Does this have support for macros? It doesn't appear to, and so feels a bit like another variant on markdown (with its own special syntax)? It's not clear to me why I'd use this, compared with RST (where I can generate LaTeX or HTML, and script with python)?

It has functions which replace macros. One would use it instead of latex because it is immeasurably faster and more sane.

Re: Typst: An easy to learn alternative for LaTex

#132

This is the sort of thing that I'm excited about because it solves problems I have, but can't really use for much because I'm not sure if it will exist in a year.

I mean, the compiler is open source, so if you download it it will exist (even if no new features / bugfixes are released).

Re: Typst: An easy to learn alternative for LaTex

#134
post #67

Earlier quoted context omitted.

I am using pandoc to transfer some of my notes to the web: https://ykonstant1.github.io/power-draft.html

I've been doing something similar, and it looks like you've managed to solve a problem I've been unable to: how did you get theorem and section numbering to work right?

Nothing special; here is the pandoc command I use to transform tex without tikz:

  for input in *.tex; do
   pandoc "${input}"                      \
          --from latex                    \
          --to html                       \
          --pdf-engine=latexmk            \
          --css="styles/texstyle.css"     \
          --standalone                    \
          --mathjax                       \
          --toc                           \
          --number-sections               \
          --output="${input%".tex"}.html" ;
  done
My pandoc version is:

  pandoc 3.1.9
  Features: +server +lua
  Scripting engine: Lua 5.4

Re: Typst: An easy to learn alternative for LaTex

#135
post #103

Typst has been pretty amazing, and at my organization, we’re very happy with it. We needed to generate over 1.5 million PDFs every night and experimented with various solutions—from Puppeteer for HTML to PDF conversions, to pdflatex and lualatex. Typst has been several orders of magnitude faster and has a lighter resource footprint. Also, templating the PDFs in LaTeX wasn’t a pleasant developer experience, but with T…

Just wondering: did your organisation contribute anything back to the project, or supported it financially in any way?

Hey. Yes we did support them financially from our FOSS fund. We’ll be happy to do it once more as well.

Re: Typst: An easy to learn alternative for LaTex

#136
post #82
post #72

Earlier quoted context omitted.

> Yes, latex's HTML output is fairly good nowadays, after a lot of people made very heroic efforts to put it in a system never intended to support it. Mind saying more? Didn't know there'd been progress here.

Have a look at https://ctan.org/pkg/lwarp and https://math.nist.gov/~BMiller/LaTeXML/ .

lwarp's output is phenomenal. Both https://tikz.dev/ and https://tikz.dev/pgfplots/ are rendered with lwarp and I daresay they are a noticeable improvement over the PDF equivalents.

Re: Typst: An easy to learn alternative for LaTex

#137
post #97

Earlier quoted context omitted.

Practically nothing in Latex comes out of the box. Sure, you can bang out markdown-esque formatted text, but the moment you need something more complicated, say URLs, graphics, resize the margins, etc you are likely going to be pulling in a package. No true scotsman and all that, but I suspect few documents in the wild are bare Latex.

But the feature I'm talking about comes out of the box. One just writes \documentclass[twoside]{article} \pagestyle{headings} in LaTeX. And this also does the right thing on special pages like table of content, appendix, bibliography etc. Implementing all that in Typst is quite a hassle.

The 'La' in 'LaTeX' stands for 'Lamport'. Leslie Lamport set up additional macros atop the base TeX language to make life easier. To this day LaTeX code can still be compiled with `pdftex` (note, no 'la' there).

The `article` document class is actually some `article.cls` file that resides somewhere in your TeX install root, is loaded, and implements macros such as `/title`, `/section`, `subsection`, and so on. All LaTeX eventually expands into a pile of TeX macros that are evaluated.

All this is to say... LaTeX comes with the templates, you've been using one all this while.

Re: Typst: An easy to learn alternative for LaTex

#138

Does this have support for macros? It doesn't appear to, and so feels a bit like another variant on markdown (with its own special syntax)? It's not clear to me why I'd use this, compared with RST (where I can generate LaTeX or HTML, and script with python)?

No, it has no macros, that is its greatest selling point. Instead you can use an embedded programming language which will look familiar to anyone who has some experience with software development to script it.

Replacing TeX's abysmal macro expansion language with a reasonably normal programming language is one of the reasons you would use it. Look at the example on their GitHub to see how the language works in a document.

Re: Typst: An easy to learn alternative for LaTex

#140
post #139

From the first example, I don't understand from the syntax why the first formula becomes inlined while the second one is centered on the page.

It's the space after and before the $. A bit weird I guess, but I think it makes some visual sense.
Post reply on HN