As someone who understand LuaLaTeX superficially and wanted to understand ConTeXt, should I go with LuaLaTeX and Typsto

Hello. I am new to the Typst Forum and I am someone who understands LuaLaTeX at a basic level. I would say that I am interesting in this typesetting thing that LaTeX and Typst resolve around, and I even know some ConTeXt. But I am unsatisfied with the documentation and found it very complicated to understand some things in context.

I want to go back to LaTeX and possibly pick up Typst, as I have the thought that since LaTeX is slow at changing but is a universal format in a lot of cases. Thought, i would also like the new, more innovate approach that Typst offer, and it is being build on something completely different from LaTeX, and I have heard that some organizations are helping support the spread of the language. I know that Typst is in beta, but maybe I should properly learn LuaLaTeX for now, and then learn Typst when the time comes for the stable version to be released.

Regarding ConTeXt, I know it is ā€˜monolithicā€™ (I know packages exist), but I feel like this can be a very big disadvantage, since i feel like this doesnā€™t allow for the community to feel free to build extensions to ConTeXt. I think there are also some aspects of ConTeXt that are probably done better since with context, youā€™re buying a value pack, but with packages you get a higher quality individual product. Is Typst basically like a community version of ConTeXt? Since context seems to change some syntax with each major version, unlike latex.

If someone could have input on this, it would be greatly appreciated.

Well obviously this is the Typst Forum so this is very opinionatedā€¦ but as soon as I got into Typst I never ever wanted to go back. I would highly recommend you to try out Typst for a few weeks and then decide if you want to ever use a TeX-based system again :smiley:

4 Likes

Obviously weā€™re biased and disclaimer, I have generally felt unwilling to actually use LaTeX; the biggest document I made with it was my Bachelorā€™s thesis, and very few papers. I canā€™t speak about other *TeXs at all.

Having LaTeX as a skill for when no alternatives are available can be sensible, depending on your plans for a career.

Typst is already quite capable, and in the sense of ā€œyou donā€™t run into rough edges all the timeā€ Iā€™d also call it pretty stable (which is why Typst has dropped the ā€œbetaā€ label, even though itā€™s not 1.0 yet). Itā€™s not stable in the ā€œwe donā€™t do breaking changes, years-old documents will compile with the newest compilerā€ sense yet, but depending on your use case that may not be a big problem.

The other issues that may have you hold back on Typst are imo:

  • you need HTML export right now
  • you need a specific package that exists in LaTeX but itā€™s too arcane to expect in Typst and too complex to just rewrite
  • you have a requirement to use LaTeX, or need to cooperate with others who are not willing to try Typst
  • you need differently sized columns, shaped text, or some other special layout that Typst doesnā€™t support yet.

Since I donā€™t know details about ConTeXt, I can only give you my description of Typst: it puts creating documents onto a proper foundational model: you donā€™t manipulate text but content and other data types, because your document and scripts are not just composed of text.
My favorite example for contrasting this: this is how youā€™d multiply a range of numbers:

\def\xmultiply#1#2{%
  \ifnum#1=\numexpr#2\relax\the\numexpr#1\relax\else
   \the\numexpr(#2)*\xmultiply{#1}{#2-1}\relax\fi}
Explanation (as far as I understand)

What does e.g. \ifnum#1=\numexpr#2 mean? Since LaTeX only manipulates text, #2 may expand to something like 9-1-1-1 which is then given to \numexpr and calculated to be equal to 6 which is then put into \ifnum#1=6 which again treats the text (e.g.) 4=6 as a mathematical comparison and branches based on it.
There was some number processing inside \numexpr and \ifnum, but their parameters and results are text again because proper numbers donā€™t exist.

In my opinion, this is not the right foundation for a scriptable document creation system, and Typst fixed this properly. The same function could be written like this:

#let xmultiply(a, b) = array.range(a, b+1).product()

Apart from of course using some built-in utilities, this is easier in Typst because we actually have loops, data types, arithmetic operators, and crucially a proper scripting mode.

Ok, rant over. If ConTeXt is similarly radical in rethinking the foundations that TeX lays, maybe itā€™s actually a good avenue to go down, but I honestly find that unlikely. Personally, I would maybe keep LaTeX as a backup skill and just try if you like Typst right now. If the roadblocks I mentioned donā€™t apply to you, I think youā€™d be quite happy!

3 Likes

I wrote my BA and MA theses as well as several essays and presentation slideshows in LaTeX. While itā€™s not perfect, I think itā€™s a great piece of software and I vastly prefer it to the most commonly used proprietary word processors and slideware.

So, why am I here on the Typst Forums? Well, I ran into a roadblock with LaTeX (LuaLaTeX, to be more exact): I started a new document for my personal notes in learning Japanese kanji with lots of tables. Compiling the whole document took 2-4 minutes (I kid you not). I did a few searches and I didnā€™t found a solution, except some posts claiming that the culprit is fontenc. It may be true, because I did notice an immediate speed-up without that package in small documents, but, to my knowledge, writing Japanese is either impossible or very cumbersome without it.

So I looked for alternatives, learned about Typst (particularly the CLI application, which I found appealing for being open source), and gave it a try, using my Japanese notes as a test bed. At the time, I could only format my tables the way I wanted with the package tablex. The initial compilation time with typst watch was around 8-10 seconds, which was already a huge improvement compared to LuaLaTeX. I migrated to Typstā€™s built-in table today, which seems to be suitable for my needs so far. The initial compilation time for the same document is now 1-2 seconds!

I also prefer the overall syntax. The one used in text mode is partially inspired by AsciiDoc, a markup language I have used for other notes in the past with great satisfaction. I have also been writing programs in languages like Python and Javascript on a hobby level, so code mode is not so alien either. (Although Iā€™m still learning.)

Overall, Iā€™m quite pleased with Typst and Iā€™m excited to see where it is going. A huge thanks to all contributors!

5 Likes

It all depends on your use case and the community around you. As I see it now, there havenā€™t been recent updates to Context, but Luatex has become the default engine for LaTeX, bringing some interesting, modern developments. You can read the latest LaTeX news here: LaTeX Project News and LaTeX2e News.

If you want a universal solution, you might consider using Pandoc to convert from Markdown to either LaTeX, Typst, or other formats. With Pandoc, you can easily create a Word document (DOCX), a webpage, and a PDF (using either LaTeX or Typst) from the same source Markdown file.

Instead of thinking about learning Typst or LaTeX/Luatex from a handbook, just start taking notes in it and see what your needs are. The Typst forum here provides really good support.

Iā€™ve been using LaTeX for over 10 years. I know how to use it, but Iā€™ve never written my own macro, template, or package (though I have modified files heavily). However, with Typst or Quarto/Pandoc (using Typst as the backend), Iā€™ve actually started contributing to a few small academic projects working on templates. So, I can say that Typst is a bit easier to learn and is more modern, though it has many limitations that may disappear as it develops.

In general, I have found writing long complex documents a lot easier with Typst than with LaTeX or Markdown for that matter, the combination of function and not needing a preamble or yaml block an advantage, and seamless integration of links and CSV in typst with tables better than anything I have experienced with LaTeX or markdown except perhaps for Commonmark and even then. Export to html is a non-issue as you can solve this with pandoc.
Everyday I marvel at the flexibility and ease of typst as a typesetting system. With quarto and pandoc support, this has all the elements to be the next ā€œbigā€ thing IMHO for data sci and AI/ML community remembering it is Rust based, so optimal performance is a feature. Some of us are a little ahead of the curve as early adopters but this thing will catch on eventually.

2 Likes