pTeX-ng Unofficial manual

1The name of the game?

It is compatible with pTeX/upTeX and intended to be its successor, including vertical writing and Unicode support, thus the name.

Asiatic pTeX is the new name, as the goal is to support more Asian (Arabic) writing systems.

2Compatibility with other TeX processors

Firstly, it is compatible with e-upTeX. So almost all the packages upLaTeX supports can be used. Other than that, specials supported by DVIPDFMx are also included since it has been integrated as a library for direct PDF output.

For MetaPost users, upMetaPost is compatible with it.

In short, if you already use upLaTeX, the transition would be almost painless. The difference and additions to upTeX are documented below (work in progress).

3Installation (for macOS)

GNU Autotools are required. You would need a TeXLive distribution installed for ApTeX does not include the TeX macro packages. BasicTeX works fine.

I would suggest compile from source. Although the git repository contains the entire TeXLive distribution for ease of maintenance, you still do not need all the TeXLive source to build ApTeX, I suggest you use scalar to partial clone it.

$ scalar clone git@github.com:clerkma/ptex-ng.git
$ cd ptex-ng/src
$ git sparse-checkout add --stdin
build-gcc
src
texlive/am
texlive/build-aux
texlive/libs/libpaper
texlive/libs/libpng
texlive/libs/zlib
texlive/texk/dvipdfm-x
texlive/texk/kpathsea
texlive/texk/ptexenc
texlive/texk/web2c/ac
texlive/texk/web2c/am
texlive/texk/web2c/kpathsea
texlive/texk/web2c/libmd5
texlive/texk/web2c/m4
usage

It does not need web2c, and is already fully in C language, which saves us from compile most of the distribution.

The installation process need some clarification. After compilation completes, you want to install the both the aptex, ptex-ng (for compatibility reasons) binary to /Library/TeX/texbin, otherwise it won't able to find texmf.cnf. You would also want to link aptex to aplatex to be able to invoke LaTeX.The instructions on setting texmf.cnf is also confusing but eventually you want to have these in the file:

TEXINPUTS.aplatex = .;$TEXMF/tex/{uplatex,platex,latex,generic,}//
TEXINPUTS.aplatex-dev = .;$TEXMF/tex/{latex-dev,uplatex,platex,latex,generic,}//
TEXINPUTS.aptex = .;$TEXMF/tex/{uptex,ptex,plain,generic,latex,}//

To generate the FMT files, first enter the usage/ directory, then edit the fmt-aptex.cnf (yes that file is outdated) to:

# plain
aptex ptex-ng language.def *ptex-ng.ini
# LaTeX
aplatex ptex-ng language.def *platex-ng.ini

After that you can generate the FMT files with:

fmtutil-sys --cnffile fmt-aptex.cnf --all

The libraries used by ApTeX are statically linked (as most TeX engines except XeTeX) so you need not worry about what happens if you update the rest of your TeXLive distribution or system libraries, it also does not matter if the TeXLive source exactly matches the currently installed version, as long as they are from the same year.

4You do (not) have OpenType

There used to be a very nice feature that allows you define CJK fonts directly from OTF or TTF using libotf like this

  \jfont\t=ot:yumin.ttf;jp90,hojo:upjisr-h
  \tfont\t=ot:yumin.ttf;vert:upjisr-v
  \jfont\t=ot:simsun.ttc[1]:upjisr-h
  \jfont\t=ot:SourceHanSansTC-Normal.otf:uprml-h

It turns out this feature is now defunct, as Ma is working on a new OpenType library (since 2020).

So, ApTeX right now has nothing much different from upTeX as you'd expect, you still need a font map to set CJK fonts.