Can ConTeXt do what luaTeX does?

Contrary to what Gaussler says, from circa 2018 there's a new format called ConTeXt LMTX (Lua, Metapost, TeX, XML) using a new engine called LuaMetaTeX. I'll try to summarize some advantages and disadvantages wrt aspects I'm familiar with. Also, by simplicity I list both ConTeXt (format) and LuaMetaTeX (engine) features.

EDIT: Gaussler is right wrt average users. ConTeXt MkIV and LuaTeX (be OpTeX, LaTeX, Plain, etc.) should be capable (theoretically) of doing essentially the same things. It's only when you need more tuning or features that differences become clear.

Advantages

  • Extended macro parser: additionally to #1...#9 you have #+ to pass an argument as-is, #- to discard an argument and #0 to gobble an argument. Companion primitives are also added. They aren't meant to be used by average users, I think. Details here: http://www.pragma-ade.com/general/manuals/evenmore.pdf
  • Finer control of boxes which allows you to e.g. "slice" text lines (http://www.pragma-ade.com/general/magazines/mag-1105-mkiv.pdf). It's possible, but more complicated using LuaTeX.
  • Finer control of text directions. LuaMetaTeX no longer supports four directions as LuaTeX did. Instead it supports two directions and presents a orientation model. Example uses include vertical typesetting: http://www.pragma-ade.com/general/manuals/followingup.pdf. Very nice for CJK and Mongolian.
  • New interface(s) to Metapost/Metafun. Aditya Mahajan has already read a nice summary of what is possible with such interfaces if you want to write your own: https://adityam.github.io/context-blog/post/new-metafun-interface/ Predefined interfaces are listed here: http://www.pragma-ade.com/general/manuals/luametafun.pdf. I mention them because Metapost by itself (as mpost) doesn't support such additions.
  • Partial SVG support via Metapost (AFAIK ConTeXt MkIV resorts to external dependencies). This include SVG fonts (e.g. emoji ones), although with some tweaks. Examples here: http://www.pragma-ade.com/general/manuals/svg-lmtx.pdf
  • A smaller binary.

Disadvantages

  • Compiled libraries (.so/.dll) aren't supported by default. This is because LuaMetaTeX doesn't fully support them and you have to include your own Lua libraries. Also, and unlike ConTeXt with LuaTeX, you need an additional flag --permitloadlib. According to LuaMetaTeX manual, "the reason for having this as option is the wish for security [...], so this might give an extra feeling of protection": http://www.pragma-ade.com/general/manuals/luametatex.pdf
  • Not really a disadvantage, but a caveat. LuaMetaTeX uses Lua 5.4 which is in active development, so minor differences (and bugs) wrt Lua 5.3 will be there.

ConTeXt (in its newest version) runs exclusively on LuaTeX. So ConTeXt can do everything LuaTeX can.

Tags:

Context

Luatex