installing luametatex

From ConTeXt wiki
Revision as of 05:42, 8 December 2019 by Otared (talk | contribs)
Jump to navigationJump 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 http://www.pragma-ade.com/install.htm [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

  • 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)
~/context-osx-64/
  • Open a Terminal window (Terminal.app is found in /Applications/Utilities). In the Terminal window type
cd ~/context-osx-64/
  • Then you should be able to execute the command
sh install.sh
  • It may happen that MacOS will not allow you to execute the above shell command, or the mtxrun script which is called by install.sh. In particular this happens beginning with MacOS 10.15 Catalina, where GateKeeper tries to protect you against yourself… 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
sh install.sh

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
~/context-osx-64/

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

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

(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
~/Library/TeXShop/Engine

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

LuaMetaTeX.engine

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

#!/bin/bash
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
LuaMetaTeX
  • In principle, once the above PATH has been added, typing in a Terminal window
which context

or

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

~/context-osx-64/tex/texmf-osx-64/bin/luametatex

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
~/context-osx-64/tex

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.