Skip to main content

Flatten a multi-file LaTeX project into a single .tex file

Project description

Latex flat

Flatten a multi-file LaTeX project into a single .tex file. Every \input and \include is recursively inlined; the result compiles on its own.

Install

pip install latex-flat

This installs the latexflat command:

latexflat <main.tex> [result.tex] [-b]

Usage

Installed command (or run the script directly with python flatten.py ...):

latexflat <main.tex> [result.tex] [-b]
  • <main.tex> — the root document (the one with \begin{document}).
  • [result.tex] — output path (overwritten). Defaults to ./result.tex.
  • -b — also copy the cited .bib file(s) next to the result.
  • -h — show help.

Example:

latexflat main.tex out.tex -b

Behaviour

  • \input / \include → inlined (paths resolved relative to the main doc's dir).
  • Lines with \includegraphics → commented out (images dropped, not deleted).
  • Comments and everything else → copied verbatim.
  • Include cycles are detected and error out.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latex_flat-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latex_flat-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file latex_flat-0.1.1.tar.gz.

File metadata

  • Download URL: latex_flat-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for latex_flat-0.1.1.tar.gz
Algorithm Hash digest
SHA256 23185c1e52e13a35664c156a21eb3d5d4f10a7c460a443768c900cf6a9a172dd
MD5 8192d82ad28c2022004f7db308613093
BLAKE2b-256 0de8bd956992bb740903524e197424aefb3b1739e233fd35837a9e2ece36f195

See more details on using hashes here.

Provenance

The following attestation bundles were made for latex_flat-0.1.1.tar.gz:

Publisher: publish.yml on HubertStach/latex_flat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file latex_flat-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: latex_flat-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for latex_flat-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bfd12c98942bbf624f8128f0bad222d1762c3c3cf22c1c0955abcdf58b46086
MD5 24da145c53f45defe9d918ca415486a6
BLAKE2b-256 edcb75fc9c0159a1a7818430a9a63b1a734945a50b7ecb6b53819f4639eed63c

See more details on using hashes here.

Provenance

The following attestation bundles were made for latex_flat-0.1.1-py3-none-any.whl:

Publisher: publish.yml on HubertStach/latex_flat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page