# man > dviluatex(1)

---
type: CommandReference
command: luatex
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `luatex file.tex` — Typeset `file.tex` to PDF (default output)
- `luatex --lua=init.lua file.tex` — Run with Lua initialization script
- `luatex --output-format=dvi file.tex` — Produce DVI output instead of PDF
- `luatex --interaction=nonstopmode file.tex` — Run without pausing on errors
- `texlua script.lua` — Execute script as a Lua interpreter
- `texluac -o bytecode.luac script.lua` — Compile Lua script to bytecode
- `luatex --shell-escape file.tex` — Enable shell command execution via `\write18`
- `luatex --ini` — Start in INI mode to dump a format

## Name

luatex, dviluatex, luahbtex, luajittex, texlua, texluac — An extended version of TeX using Lua as an embedded scripting language

## Synopsis

`luatex` [**--lua=**_FILE_] [_OPTION_]... [_TEXNAME_[**.tex**]] [_COMMANDS_]

`luatex` [**--lua=**_FILE_] [_OPTION_]... **\**_FIRST-LINE_

`luatex` [**--lua=**_FILE_] [_OPTION_]... **&**_FMT_ [_ARGS_]

## Options

### Initialization and Format

- `--lua=FILE` — Load Lua initialization file before parsing other options
- `--fmt=FORMAT` — Use FORMAT as the format name instead of the default
- `--ini` — Start in INI mode for dumping formats
- `--progname=NAME` — Pretend to be program NAME (for kpathsea)

### Output Control

- `--draftmode` — Enable `\pdfdraftmode`; skip writing PDF and reading images
- `--output-comment=STRING` — Set DVI comment string (ignored in PDF mode)
- `--output-directory=DIR` — Write output files to DIR, look for inputs there first
- `--output-format=FORMAT` — Set output format: `pdf` or `dvi`
- `--jobname=NAME` — Override job name
- `--recorder` — Enable filename recorder (output `.fls` file)
- `--synctex=NUMBER` — Enable/disable SyncTeX extension

### Security and Execution

- `--shell-escape` — Enable `\write18` and Lua functions `os.execute()`, `os.exec()`, `os.spawn()`, `io.popen()`
- `--no-shell-escape` — Disable these even if enabled in `texmf.cnf`
- `--shell-restricted` — Allow only commands listed in `texmf.cnf`
- `--safer` — Disable Lua commands easily abused by malicious documents
- `--nosocket` — Disable the luasocket (network) library
- `--enable-write18` — Synonym for `--shell-escape`
- `--disable-write18` — Synonym for `--no-shell-escape`

### Debugging and Interaction

- `--debug-format` — Debug format loading
- `--file-line-error` — Print errors as `file:line:error`
- `--no-file-line-error` — Disable file-line-error format
- `--interaction=MODE` — Set interaction mode: `batchmode`, `nonstopmode`, `scrollmode`, `errorstopmode`
- `--kpathsea-debug=BITMASK` — Set path searching debug flags
- `--help` — Print help and exit
- `--version` — Print version and exit
- `--credits` — Print credits and version details

### Lua Interpreter Modes

- `--luaonly` — Act as a Lua interpreter (similar to `texlua`)
- `--luaconly` — Act as a Lua bytecode compiler (similar to `texluac`)

### Ignored Options (always on or off)

- `--8bit`, `--etex`, `--parse-first-line`, `--no-parse-first-line` — Always on
- `--default-translate-file=TCXNAME`, `--translate-file=TCXNAME` — Always off

## Examples

shell
# Typeset a document
luatex mydoc.tex

# Produce DVI output
luatex --output-format=dvi mydoc.tex

# Use a Lua initialization script
luatex --lua=init.lua mydoc.tex

# Run as a Lua interpreter
texlua myscript.lua

# Compile Lua script to bytecode
texluac -o myscript.luac myscript.lua

# Enable shell escape with restricted commands
luatex --shell-restricted mydoc.tex

# Run interactively without pausing
luatex --interaction=nonstopmode mydoc.tex

# Dump a format file
luatex --ini myformat.tex
## See Also

[pdftex(1)](https://www.chedong.com/phpMan.php/man/pdftex/1/markdown), [etex(1)](https://www.chedong.com/phpMan.php/man/etex/1/markdown), [aleph(1)](https://www.chedong.com/phpMan.php/man/aleph/1/markdown), [lua(1)](https://www.chedong.com/phpMan.php/man/lua/1/markdown)