
Hi Gerion, On Fri, 2025-04-11 at 00:36 +0200, Gerion Entrup wrote:
I just published my PhD thesis in ConTeXt (with graphics in LaTeX/TikZ)
I published the source code here [2] to maybe give something back.
Wow, that looks great, thanks for sharing!
In general, I find ConTeXt way more consistent than LaTeX. I really like the key value interface for most functions. It also feels like (and is) a complete system (not like LaTeX as a system consisting of _a lot of_ different modules, most of them playing together just most of the times).
Agreed.
BTW, does a public Lua interface of ConTeXt exist with a reference what ConTeXt specific functions can be called directly in Lua?
"cld-mkiv.pdf" is the main manual, although there's lots not listed there. Most of the newer manuals mention the Lua interfaces for their specific topic, but they don't usually go into too much depth. Often, you'll have to check the Wiki, check the mailing list archives, or refer to the source.
I find the ConTeXt source code hard to read. I dug around in the source code for typesetting references to personalize them and needed time to find the files that are responsible for this and understand the relevant variable and function names therein.
Yeah, I agree that it's not the easiest to read, but it's certainly *far* better than LaTeX. And the newer code is usually pretty nice, so it's often only the older code (or the code that does inherently complex stuff, like for fonts) that's tricky. And you do get used to it after awhile, although it took a couple years for me.
When searching (grep) for a command, I often got some really long lists of commands containing the one I searched for, but I had a hard time finding the TeX and Lua code that implemented that specific command.
Most of the commands are just \def'ed, so searching for "\def\yourmacroname" will often work. "\define" and "\let" are also sometimes used. For the Lua-based commands, their names look like \clf_yourmacroname and are defined by interfaces.implement, so you can usually search for "name\s*=\s*['\"]yourmacroname['\"]" You can also run mtxrun --script interface --meaning yourmacroname although I admittedly never use that one myself.
I also needed some time to find out that manuals exist for most parts (first source for information was the wiki). When I found them, though, they were really helpful, especially for more low level knowledge (and as code examples).
Yeah, some of the manuals are super obvious (like for math and metafun), but others are rather hidden. Like, "cld-mkiv.pdf" is for Lua, "details.pdf" is for grid snapping, etc. Some other good manuals to look into are "onandon.pdf", "lowlevel.pdf", "ontarget.pdf", and "evenmore.pdf". (Also, what happened to "primitives.pdf"? That was one of my favourite documents!)
Also, ConTeXt is way faster than LaTeX
Yes, indeed, this is one of my favourite parts of ConTeXt.
(though much slower than Typst but AFAIK, Typst is not as complete as ConTeXt).
Yeah, Typst is faster than pretty much anything, but they put in _a lot_ of work to get it that way, and it comes with quite a few limitations: https://www.researchgate.net/publication/364622490 Thanks -- Max