CTAN Comprehensive TeX Archive Network

CTAN update: runtexshebang

Datum: 22. Oktober 2026 05:20:10 MESZ
Munehiro Yamamoto submitted an update to the runtexshebang package. Version: 1.1 2026-10-21 License: lppl1.3c Summary description: A Lua script running LaTeX document files with TeX-style shebang Announcement text:
runtexshebang v1.1 refuses a TeX-style shebang (%#!) line that contains an ASCII control character other than TAB, both when running it and with --dry-run. A carriage return or an escape sequence in that line could make the command shown on the terminal differ from the command the shell actually runs. Non-ASCII bytes are not checked, so UTF-8, Shift_JIS and EUC-JP file names keep working. The test suite now also checks that runtexshebang never loads Lua modules placed in the current directory. runtexshebang 1.0 runs the `%#!` line of a LaTeX document through the system shell, as before, but is now more careful about it. ## Changes - The license is now the LaTeX Project Public License 1.3c (was MIT). - The command of the `%#!` line is printed on stderr before it is run, and its exit status is passed through, so editors and `make` can detect failures. - CRLF line endings and a UTF-8 byte order mark before `%#!` are handled; only the leading `%#!` is removed from the line. - Missing files, an empty `%#!` line and unknown options are reported with a message and a non-zero exit status instead of a Lua traceback. `--` ends option parsing. - On Windows, `NoDefaultCurrentDirectoryInExePath=1` is set before the command runs, so an executable placed next to the document cannot shadow a TeX Live program named on the `%#!` line. - The README has a new Security section. In short: running runtexshebang on a document is equivalent to typing its `%#!` line yourself, so use it only on documents you trust, and never add it to `shell_escape_commands`. - PDF documentation is included.
This package is located at https://mirrors.ctan.org/support/runtexshebang More information is at https://ctan.org/pkg/runtexshebang
Thanks for the upload. For the CTAN Team Manfred Lotz CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs .

Runshebang – A Lua script running document files with -style shebang

In short, a -style shebang (%#!) is a special kind of comment that you include in your / document file to tell the operating system’s shell how to run the file for the rest of the file:

      %#!lualatex foo.tex
      \documentclass{article}
      \begin{document}
        Hello, {\} World!
Happy {\}ing. \end{document}

If you are using a -style shebang, it must appear on the line that matched 20 lines or less in your document, and it has to start with a comment symbol (%) followed by a hash sign (#) and an exclamation mark (!), colloquially known as the bang, hence the name shebang for /.

runtexshebang executes the %#! line through the system shell, so only use it on documents you trust. It is a build tool invoked by the user and must not be added to shell_escape_commands.

PaketRunTeXshebang
Version1.1 2026-10-21
Copyright2021–2026 Munehiro Yamamoto
BetreuerMunehiro Yamamoto

Ankündigungen

mehr

Gästebuch Seiten-Struktur Impressum Autor kontaktieren