Skip to content

global texio

The texio library takes care of the low-level I/O interface: writing to the log file and/or console.

😱 Types incomplete or incorrect? 🙏 Please contribute!


methods


texio.write


function texio.write(
  target: WriteTarget,
  ...: string
)

Write all given strings to a target.

Reference:

texio.write


function texio.write(...: string)

Write all given strings to the same location(s) TeX writes messages to at this moment.

If batchmode is in effect, it writes only to the log, otherwise it writes to the log and the terminal.

Reference:

texio.write_nl


function texio.write_nl(
  target: WriteTarget,
  ...: string
)

Write all given strings to a target.

It makes sure that the given strings will appear at the beginning of a new line.

Reference:

texio.write_nl


function texio.write_nl(...: string)

Write all given strings to the same location(s) TeX writes messages to at this moment. It makes sure that the given strings will appear at the beginning of a new line.

Note: If several strings are given, and if the first of these strings is or might be one of the targets above, the target must be specified explicitly to prevent Lua from interpreting the first string as the target.

Reference:

texio.setescape


function texio.setescape(escape_controls: boolean)

Disable ^^ escaping of control characters.

Reference:

texio.closeinput


function texio.closeinput()

Force a jump back to TeX.

This function should be used with care. It acts as endinput but at the Lua end. Normally Lua will just collect prints and at the end bump an input level and flush these prints. This function can help you stay at the current level but you need to know what you're doing (or more precise: what TeX is doing with input).

Reference:

😱 Types incomplete or incorrect? 🙏 Please contribute!