Skip to main content

A command-line tool to flatten LaTeX projects into a single root directory for easy submission.

Project description

lateflat

lateflat is a command-line tool to flatten a LaTeX project into a single root directory, simplifying organization for project submission.

Features

  • Merges all files in a LaTeX project into a single directory.
  • Updates \input and \includegraphics paths for compatibility in the flattened structure.
  • Supports easy integration into CI/CD pipelines for automated submission preparations.

Installation

Requires Python 3.7 or higher. Install using:

pip install lateflat

Usage

To flatten a LaTeX project (including the article file named main.tex):

lateflat <path_to_your_latex_project>

This will organize all files in <path_to_your_latex_project> into a single main article file along with supplementary files (such as images, .sty, .cls, and .bib) in a submission-ready directory.

Additionally, it can output a zipped version of the flattened project directory if needed, making it easy to submit as a single article file along with supplementary files.

Example Directory Structure

Assume your original LaTeX project structure is as follows:

project/
├── main.tex
├── sections/
│   ├── intro.tex
│   ├── methods.tex
│   └── results.tex
├── figures/
│   ├── fig1.png
│   └── fig2.png
│── custom.sty
│── formatting.cls
└── references.bib

After running lateflat project, the structure will be flattened to:

project/
└──submit/
│   ├── main.tex # including contents of intro.tex, methods.tex and result.tex
│   ├── fig1.png
│   ├── fig2.png
│   ├── custom.sty
│   ├── formatting.cls
│   └── references.bib
└── other files

In this flattened structure, all files are moved to a single root directory (submit), with \input and \includegraphics paths in main.tex updated accordingly.

License

This project is licensed under the terms of the Apache License. See LICENSE for details.

Contributing

Feel free to contribute! Fork the repository, make a pull request, or open an issue to discuss potential features.

Contact

Maintainer: Nkzono99

Repository: GitHub - lateflat

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

lateflat-0.1.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

lateflat-0.1.1-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

Supported by

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