Installing ConTeXt LMTX on MacOS

From Wiki
Jump to navigation Jump to search

Since April 2019, there is a new flavor of ConTeXt, named « LuaMetaTeX » meant to integrate Lua, Metapost and TeX, the latter meaning ConTeXt. It is going to be self-contained and smaller than previous versions of ConTeXt mkiv and mkii.

See [1] where you can find the installer script for the machine you are using.

Since a few users have encountered difficulties in installing, and updating to, beta releases of LuaMetaTeX on MacOS, below we describe an installtion procedure for MacOS. For other platforms the procedures are more or less analogous.

Installing on MacOS up to 10.14

  • Beware: As of December 2019, the following instructions work for MacOS up to version 10.14 but do not work for MacOS 10.15 Catalina, due to the Apple's System Integrity Protection (SIP). Please see the dedicated section for installing on MacOS 10.15 Catalina
  • Put the unzipped folder « context-osx-64 « whereever you wish: for instance in your home directory. Thus the path to your future LuaMetaTeX directory will be (and below this is what we assume)
  • Open a Terminal window ( is found in /Applications/Utilities). In the Terminal window type
cd ~/context-osx-64/
  • Then you should be able to execute the command
  • It may happen that MacOS will not allow you to execute the above shell command, or the mtxrun script which is called by In that case, you should open the System Préferences (from the Apple menu) and there choose Security & Privacy, and go to the General pane. There you should be able to authorize the shell script, which has been blocked, to be executed. After that you issue again the command

and MacOS will ask you again whether you really want to execute mtxrun: you say YES!

  • After that, if everything goes smoothly a complete functionning tree of LuaMetaTeX, complete with dozens of manuals, will be installed in the folder

and whenever you want to update your installation of LuaMetaTeX, it is enough to go to the above directory in Terminal and do again

  • If you want to use LuaMetaTeX from the Terminal interface you should add the path of your installation to $PATH by adding to your

(or any other flavor of shell interface you are using) the line

export PATH=~/context-osx-64/tex/texmf-osx-64/bin:~/context-osx-64/bin:~/context-osx-64/tex/texmf-osx-64/bin:$PATH

(if you have installed « context-osx-64 » elsewhere, please replace the segment « ~/context-osx-64 » with the path to that folder).

  • A better choice is to use TeXShop [2]. Once TeXShop is installed, go to

and there duplicate for instance the file « ConTeXt (LuaTeX).engine » (or any other of the files « .engine »). Name the duplicate


and open it in TeXShop (or any text editor). Replace the content of the file « LuaMetaTeX.engine » with the following lines:

export PATH=~/context-osx-64/tex/texmf-osx-64/bin:~/context-osx-64/bin:~/context-osx-64/tex/texmf-osx-64/bin
~/context-osx-64/tex/texmf-osx-64/bin/mtxrun --autogenerate --script context --directives="system.showerror" --autopdf "$1" --purgeall

then save and close the file.

  • If you want to use LuaMetaTeX as your default TeX typesetter in TeXShop, go to TeXShop -> Preferences, then under the tab « Typesetting » and the « Default Command » section choose the radio button « Command listed below « and below that type
  • In principle, once the above PATH has been added, typing in a Terminal window
which context


context --version

you should get the path to context binary and its version. If this is the case, then you can typeset a file named « myfile.tex » from the Terminal by typing:

context myfile.tex
  • It may happen that for some reasons not everything goes smoothly and you cannot typeset any document. In that case, try typing in a Terminal window:
which luametatex

in order to see whether


is present or not.

  • If not, the download has not been complete.
  • If luametatex is present, in the Terminal type:
luametatex --version

and see whether it says, among other things:

Functionality : level 20191206

(here 20191206 is the date stamp of luametatex, of course this will change during time). If not, there might be an issue with the files you have downloaded.

  • If yes, in the folder

remove the folder « texmf-cache » and then in the Terminal run:

mtxrun --generate

In principle, after that, the folder texmf-cache is present again.

  • If this is the case, in the Terminal window type:
context --make --all

If everything goes nicely, you should be able to see LuaMetaTeX functionning.