Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

Every LTX project is described by an ltx.toml at its root. The ltx new command generates this file automatically. Only two sections exist: [project] for metadata and [build] for compilation settings.

Full reference

[project]
name = "my-paper"          # Required. Project name.
version = "0.1.0"          # Optional. Semver version string.
author = ["Author Name"]   # Optional. List of authors.
main = "src/main.tex"      # Required (validation). Path to the main .tex file.

[build]
name = "my-paper"          # Required (validation). Output PDF name, no extension.
engine = "tectonic"        # Required. pdflatex | xelatex | lualatex | tectonic
engine_args = ["-synctex=1"]   # Optional. Extra compiler arguments.

[build.options]            # Optional. Tectonic compilation options.
keep_logs = true           # Optional. Keep the .log file.   Default: true
keep_intermediates = false # Optional. Keep .aux/.synctex.gz. Default: false
synctex = true             # Optional. Emit SyncTeX data.     Default: true
only_cached = false        # Optional. Never hit the network. Default: false

The compiled PDF is always written to the project’s target/ directory — there is no output-directory option.

Sections

[project]

FieldTypeRequiredDescription
namestringYesProject name.
versionstringNoSemver version string.
authorlist of stringsNoProject authors.
mainstringYes*Path to the main .tex file relative to the project root.

* main is optional in the data model but required by validationltx build and ltx check refuse to run without it. See LTX::CONFIG::E001 in the Config Errors table.

[build]

FieldTypeRequiredDescription
namestringYes*Output PDF filename (without .pdf extension).
enginestringYesLaTeX engine: pdflatex, xelatex, lualatex, or tectonic.
engine_argslist of stringsNoExtra command-line arguments passed to the compiler.

* name is required by validation (LTX::CONFIG::E003).

[build.options]

Tectonic compilation options. Every field defaults to a sensible value when omitted, so a project only sets the options it wants to override.

FieldTypeDefaultDescription
keep_logsbooltrueKeep the .log file produced by the compiler.
keep_intermediatesboolfalseKeep intermediate build artifacts (.aux, .synctex.gz).
synctexbooltrueEmit SyncTeX data for editor / PDF synchronization.
only_cachedboolfalseIf true, never hit the network — fail if the bundle isn’t cached.

Validation rules

ltx build validates the manifest before compiling. Malformed TOML and unknown keys (e.g. a typo like [build.option]) are rejected loudly instead of silently ignored. The structural rules enforced by validate_manifest():

  1. [project].main is set and points to an existing file on disk (LTX::CONFIG::E001, LTX::CONFIG::E004).
  2. A [build] section is present (LTX::CONFIG::E002).
  3. [build].name is non-empty (LTX::CONFIG::E003).

Scaffolding options

When you run ltx new, the directory layout is controlled by flags that map to internal options:

SrcLayout — source file placement

FlagLayoutResult
(none)Flatmain.tex in project root
--srcWithSrcDirsrc/main.tex + src/sections/

BibLayout — bibliography placement

FlagLayoutResult
(none)Flatreferences.bib in project root
--bibWithBibDirbib/references.bib

These flags combine freely. For example, ltx new paper --src --bib creates:

paper/
├── src/
│   ├── main.tex
│   └── sections/
├── bib/
│   └── references.bib
├── ltx.toml
└── .gitignore

Minimal config

A project with just the essentials (generated by ltx new my-paper):

[project]
name = "my-paper"
main = "main.tex"

[build]
name = "my-paper"
engine = "tectonic"

Example: bibliography project

[project]
name = "thesis"
version = "0.1.0"
author = ["Jane Doe <jane@example.com>"]
main = "src/main.tex"

[build]
name = "thesis"
engine = "tectonic"

[build.options]
keep_logs = false
only_cached = true