---
name: "spix"
section: "1"
platform: "linux"
package: "texlive-doc"
version: "2026.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/spix"
---

# spix(1)

Compile a .tex file, executing commands that are set inside the file itself.

## NAME

spix - Compile a .tex file, executing commands that are set inside the file itself.

## SYNOPSIS

**spix** \[**--version**\] \[**-h**\] \[**-n**\] *file*

## DESCRIPTION

**spix** parses a .tex file to find lines starting with *%$* (before the preambule). Those lines are shell commands that are executed by **spix**.

Commands are executed as-is, excepted that:

\- command are run from the directory of the file given in argument;

\- shell variables *$texname* and *$basename* are set to the name of the tex file (respectively with and without the .tex extension).

## OPTIONS

- **-n**, **--dry-run**

  Print the commands that would be executed, but do not execute them.

- **-h**, **--help**

  Print help, and exit.

- **--version**

  Print version, and exit.

## EXAMPLES

Let *foo.tex* be the following file.

```
% Compile this file twice with lualatex.
%$ lualatex foo.tex
%$ lualatex foo.tex
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
```

When running **spix** on this file, it is compiled twice using **[lualatex(1)](/lualatex/1.md)** (as written in lines 2 and 3 of the file).
