Metadata-Version: 2.1
Name: tartex
Version: 0.2.0
Summary: Tar all files needed to re-compile your LaTeX project
Project-URL: Documentation, https://github.com/badshah400/tartex#readme
Project-URL: Issues, https://github.com/badshah400/tartex/issues
Project-URL: Source, https://github.com/badshah400/tartex
Author-email: Atri Bhattacharya <atrib@duck.com>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: LaTeX,latexmk,tar
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# tartex

[![PyPI - Version](https://img.shields.io/pypi/v/tartex.svg)](https://pypi.org/project/tartex)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tartex.svg)](https://pypi.org/project/tartex)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)

-----

TarTeX is a command-line utility to generate a tarball including all
(non-system) source files needed to compile your LaTeX project.

**Table of Contents**

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Similar utilities](#similar-utilities)

## Features

* Defaults to including the least number of files needed to recompile your LaTeX project in the output tar file.
* Creates tarballs compatible with arXiv (and most journal) requirements.
* Automatically determines pdf or ps processing based on source dir contents.
* Supports different compression methods for output tarball.
* Preserves directory structure in generated tarball, i.e. no flattening.
* Handy options to allow edge cases.

## Installation

__Note__: Unless you provide a prepared ".fls" file as `filename` input, you
must have `latexmk` and `pdflatex`, as well as a full LaTeX env installed to
allow compilation of your LaTeX project. `tartex` does not include any
system-wide files, such as TeX style files, classes, etc. in the tar file.

### Using pipx

This is the easy way to install tagged releases.

```console
pipx install tartex
```

### From GitHub sources:

Compile using [hatch](https://hatch.pypa.io/latest/) to generate a wheel,
which may be then installed using `pipx` as follows:

```console
git clone https://github.com/badshah400/tartex.git
cd tartex
hatch build
pipx install ./dist/*.whl
```

## Usage

Supported OS: Potentially any POSIX-like, tested _only_ on Linux.

```console
sage: tartex [options] filename

Build a tarball including all source files needed to compile your LaTeX project (version 0.2.0).

positional arguments:
  filename              Input file name (with .tex or .fls suffix)

options:
  -h, --help            show this help message and exit
  -a ADD, --add ADD     Comma separated list of additional files (wildcards allowed!) to include (loc relative to main TeX file)
  -b, --bib             find and add bib file to tarball
  -l, --list            Print a list of files to include and quit (no tarball generated)
  -o OUTPUT, --output OUTPUT
                        Name of output tar file (suffix can determine tar compression)
  -s, --summary         Print a summary at the end
  -v, --verbose         Print file names added to tarball
  -x EXCL, --excl EXCL  Comma separated list of files (wildcards allowed!) to exclude (loc relative to main TeX file)
  -j, --bzip2           bzip2 (.tar.bz2) compression (overrides OUTPUT ext if needed)
  -J, --xz              lzma (.tar.xz) compression (overrides OUTPUT ext if needed)
  -z, --gzip            gzip (.tar.gz) compression (overrides OUTPUT ext if needed)
  -V, --version         Print tartex version

Options for latexmk processing:
  --latexmk_tex {dvi,luatex,lualatex,pdf,pdflua,ps,xdv,xelatex}
                        Force TeX processing mode used by latexmk
  -F, --force_recompile
                        Force recompilation even if .fls exists
```

__Note__: If the source dir of your LaTeX project already contains the `.fls`
file previously generated by, say `latex -record` or `latexmk`, then `tartex`
will directly use that file to determine which input files to include in the
tarball. Otherwise, `tartex` will recompile your project using `latexmk` in a
temp dir and use the `.fls` file generated there. To be precise, recompilation
will invoke:

```console
latexmk -f -<texmode> -cd -outdir=<tmpdir> -interaction=nonstopmode filename
```

`texmode` is one of `pdf` or `ps` by default, as detemined from the contents of
the source dir. It may be overridden by the `--latexmk_tex` option.


## License

`tartex` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## Similar utilities

* [bundledoc](https://ctan.org/tex-archive/support/bundledoc) is a post-processor for the `snapshot` package that bundles together all the classes, packages and files needed to build a given LaTeX document.
