Generated from folio-assistant-sci/skills/content/folio-paper-adapter/latex-compilation.md — do not edit here.

✎ Edit this page’s source

LaTeX Compilation Skill

Purpose

Compile LaTeX source files (e.g. main.tex, standalone chapters, diffs) into PDF documents using the platform’s TeX toolchain (latexmk, pdflatex, and biber).

Required Capabilities

  • latex-compiler: Full LaTeX distribution with latexmk and biber installed and executable on the host path. Detection method: latexmk --version.

Mechanisms & Tools

  • Tool Node: latexmk-compile (satisfies latex-compilation).
  • Script: cat-harness-tools/scripts/latexmk-compile.sh <tex-file> [latexmk-args...]

Usage

# Monolithic paper compilation
cat-harness-tools/scripts/latexmk-compile.sh main.tex

# Quiet compilation with extra arguments
cat-harness-tools/scripts/latexmk-compile.sh diff.tex --quiet

# Standalone glossary / appendix compilation
cat-harness-tools/scripts/latexmk-compile.sh standalone-glossary.tex

Security Boundary — Safe Shell-Escape

-shell-escape allows LaTeX to invoke arbitrary external binaries. To prevent untrusted TeX payloads from executing code in CI environments:

  1. Trusted events (push, workflow_dispatch): Shell-escape is enabled (pdflatex -shell-escape %O %S).
  2. Untrusted events (pull_request, pull_request_target, etc.): Shell-escape is strictly disabled (pdflatex %O %S).

Exit Code Contract

In adherence to the platform’s exit code standard:

Exit CodeMeaningCondition
0SuccessCompilation succeeded and PDF was produced.
1Failure / ErrorSyntax errors, unresolved references, or fatal TeX errors.
2Could-not-determineMissing positional argument <tex-file>, or target file not found on disk.
127Command not foundlatexmk or pdflatex missing from the environment.

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev