Option style for LuaTeX

Bruno Voisin bvoisin at icloud.com
Wed Dec 20 14:36:24 CET 2023


A quick question in case somebody here knows: does LuaTeX accept options in "single-dash style", like -file-line-error, or does it insist on "double-dash style", like --file-line-error?

The help messages for pdfTeX and XeTeX mention single-dash options, and the message for LuaTeX double-dash options. As shown at

https://www.overleaf.com/learn/latex/TeX_engine_command_line_options_for_pdfTeX%2C_XeTeX_and_LuaTeX

I was thinking this was just a detail, and both option styles were accepted by all three. The pdfTeX PDF doc says this explicitly: "All options can be specified with one or two dashes and unambiguously abbreviated." The LuaTeX PDF doc says nothing about this, I thought it was implicitly the same.

But I'm seeing odd behaviour in LuaLaTeX with TeXShop's engine files (ie shell scripts to run the binaries), which generally use single-dash options like "-file-line-error -synctex=1", so I'm starting to wonder. Probably unrelated though.

I'm not a programmer, so I can only guess. According to that StackExchange answer

https://superuser.com/a/372459

single-dash options use getopt which is posix while double-dash options use getopt_long which isn't.

Looking at the LuaTeX code (not sure I'm looking at the right place),

https://tug.org/svn/texlive/trunk/Build/source/texk/web2c/luatexdir/lua/luainit.c?revision=66967&view=markup

uses getopt_long_only on line 366. Does this mean LuaTeX only accepts double-dash options?

Bruno Voisin

PS Please cc the answer to me, I'm not subscribed to the list.


More information about the tex-live mailing list.