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.

Usage

python flatten.py <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:

python flatten.py 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.0.tar.gz (4.2 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.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: latex_flat-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 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.0.tar.gz
Algorithm Hash digest
SHA256 066e07afc1e4d53bdcd4375c27d29b24c936ab35b30f24690b697dce19bbf313
MD5 162f5092903cf30291064fda5d4c5472
BLAKE2b-256 545fc00bdd70d01cea59b345b0c1a3d453315d93fe179d41d88619a3e7e1058b

See more details on using hashes here.

Provenance

The following attestation bundles were made for latex_flat-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: latex_flat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c23d0690de77e4ce2f2bf43453f3c1e23cbe43630e2be846147387740a1f4d21
MD5 816d4e41d7608edde545335f4d375f46
BLAKE2b-256 a7d622bc4f71437e462bf9049b4cc5478e409e2a012901c9b0f6306105af64b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for latex_flat-0.1.0-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