-
-
Notifications
You must be signed in to change notification settings - Fork 268
Testing live dev formats
Package authors testing code against new versions of LaTeX may want to check out the ‘live’ code before it is official released to CTAN.
The simplest approach to doing this is to install latex
locally and then rebuild the
formats:
% within the latex2e repository
l3build install
fmtutil-user --refresh
However, in doing so the user's texmfhome
folder will have quite a number of files
added to it and the new formats will now take precedence over the installed ones.
Nonetheless, this can be undone by:
l3build uninstall
fmtutil-user --refresh
The main disadvantage of this approach is that the continual re-generation of formats takes some time if code needs to be tested against both CTAN and ‘live’ code.
Most testing that needs to be done will not involve all formats. fmtutil
can be requested to only regenerate certain formats, or a custom fmtutil.cnf
file can be written. I have chosen to do the latter:
fmtutil-user --cnffile ~/Dropbox/texmf-dev/web2c/fmtutil.cnf --refresh
where the CNF file contains:
pdflatex-dev pdftex language.dat -translate-file=cp227.tcx *pdflatex.ini
lualatex-dev luahbtex language.dat,language.dat.lua lualatex.ini
xelatex-dev xetex language.dat -etex xelatex.ini
(these lines simply copied from the standard fmtutil.cnf
file.)
After running the fmtutil
command, the location of the formats generate is specified with a line such as:
fmtutil [INFO]: writing formats under /Users/will/Library/texlive/2019/texmf-var/web2c
We can verify this corresponds to the directory TEXMFVAR
using texdoc fmtutil
and kpsewhich -var-value=TEXMFVAR
.
If we change the value of TEXMFVAR
before generating the formats, we can then easily switch between CTAN and ‘live’ versions of latex-dev
.
The installation procedure then becomes:
% within latex2e git repository (top-level)
mkdir -p '~/Dropbox/texmf-dev'
mkdir -p '~/Library/texlive-dev/2019/texmf-var/'
tlmgr conf texmf TEXMFHOME '~/Dropbox/texmf-dev'
tlmgr conf texmf TEXMFVAR '~/Library/texlive-dev/2019/texmf-var/'
l3build install
fmtutil-user --cnffile ~/Dropbox/texmf-dev/web2c/fmtutil.cnf --refresh
tlmgr conf texmf TEXMFHOME '~/Dropbox/texmf'
tlmgr conf texmf TEXMFVAR '~/Library/texlive/2019/texmf-var/'
Following this, no changes should be apparent when processing documents using pdflatex-dev
; the CTAN version should still be used.
Using a wrapper for one of the dev
engines such as the following will use the format built with the ‘live’ code:
#!/bin/bash
oldtexmfhome=`kpsewhich -var-value TEXMFHOME`
oldtexmfvar=`kpsewhich -var-value TEXMFVAR`
tlmgr conf texmf TEXMFHOME '~/Dropbox/texmf-dev'
tlmgr conf texmf TEXMFVAR '~/Library/texlive-dev/2019/texmf-var/'
/Library/TeX/texbin/lualatex-dev -file-line-error -synctex=1 -shell-escape "$1"
tlmgr conf texmf TEXMFHOME $oldtexmfhome
tlmgr conf texmf TEXMFVAR $oldtexmfvar