tex-minify


Nametex-minify JSON
Version 0.2.6 PyPI version JSON
download
home_pageNone
SummaryA CLI tool to expand \input commands in TeX files and filter BibTeX files based on citations.
upload_time2024-12-16 18:07:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords cli latex preprocessor tex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tex-minify

A command-line tool to expand `\input` commands in TeX files and filter BibTeX files based on citations.

## Features

- Recursively expands all `\input` commands in TeX files
- Handles relative paths correctly
- Supports both `.tex` extension present or not in `\input` commands
- UTF-8 encoding support
- Configurable base directory for input resolution
- Filter BibTeX files to only keep cited references

## Usage

### Using uvx (no installation required)

```bash
# Minify a TeX file (prints to stdout)
uvx tex-minify minify input.tex

# Save minified output to file
uvx tex-minify minify input.tex -o output.tex

# Specify base directory for \input resolution
uvx tex-minify minify input.tex --base-dir /path/to/tex/files -o output.tex

# Filter BibTeX file to only keep cited references
uvx tex-minify filter-bib paper.tex references.bib -o filtered.bib
```

### Using pip installation

First install:
```bash
pip install tex-minify
```

Then use:
```bash
# Minify a TeX file
tex-minify minify input.tex -o output.tex

# Filter BibTeX file
tex-minify filter-bib paper.tex references.bib -o filtered.bib
```

### Using pixi (for development)

```bash
# Setup development environment
pixi install
pixi run install

# Run the tool
pixi run -- tex-minify minify input.tex
pixi run -- tex-minify filter-bib paper.tex references.bib
```

## Commands

### minify

Process a TeX file and expand all `\input` commands.

```bash
tex-minify minify INPUT_FILE [-o OUTPUT] [--base-dir BASE_DIR]
```

Arguments:
- `INPUT_FILE`: Path to the input TeX file
- `-o, --output`: Output file path (optional, defaults to stdout)
- `--base-dir`: Base directory for resolving `\input` paths (optional, defaults to input file directory)

### filter-bib

Filter a BibTeX file to only include references that are cited in the TeX file.

```bash
tex-minify filter-bib TEX_FILE BIB_FILE [-o OUTPUT]
```

Arguments:
- `TEX_FILE`: Path to the TeX file containing citations
- `BIB_FILE`: Path to the BibTeX file to filter
- `-o, --output`: Output file path (optional, defaults to stdout)

## Error Handling

The tool will exit with a non-zero status code and display an error message if:
- Input files are not found
- Referenced `\input` files are not found
- Output file cannot be written
- Any other processing errors occur
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tex-minify",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "cli, latex, preprocessor, tex",
    "author": null,
    "author_email": "Dariush Wahdany <dariushwahdany@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/28/82/cdd79978ac18b2265e370c8a3a64e6bfbb3a95ca87243001e416307ab41b/tex_minify-0.2.6.tar.gz",
    "platform": null,
    "description": "# tex-minify\n\nA command-line tool to expand `\\input` commands in TeX files and filter BibTeX files based on citations.\n\n## Features\n\n- Recursively expands all `\\input` commands in TeX files\n- Handles relative paths correctly\n- Supports both `.tex` extension present or not in `\\input` commands\n- UTF-8 encoding support\n- Configurable base directory for input resolution\n- Filter BibTeX files to only keep cited references\n\n## Usage\n\n### Using uvx (no installation required)\n\n```bash\n# Minify a TeX file (prints to stdout)\nuvx tex-minify minify input.tex\n\n# Save minified output to file\nuvx tex-minify minify input.tex -o output.tex\n\n# Specify base directory for \\input resolution\nuvx tex-minify minify input.tex --base-dir /path/to/tex/files -o output.tex\n\n# Filter BibTeX file to only keep cited references\nuvx tex-minify filter-bib paper.tex references.bib -o filtered.bib\n```\n\n### Using pip installation\n\nFirst install:\n```bash\npip install tex-minify\n```\n\nThen use:\n```bash\n# Minify a TeX file\ntex-minify minify input.tex -o output.tex\n\n# Filter BibTeX file\ntex-minify filter-bib paper.tex references.bib -o filtered.bib\n```\n\n### Using pixi (for development)\n\n```bash\n# Setup development environment\npixi install\npixi run install\n\n# Run the tool\npixi run -- tex-minify minify input.tex\npixi run -- tex-minify filter-bib paper.tex references.bib\n```\n\n## Commands\n\n### minify\n\nProcess a TeX file and expand all `\\input` commands.\n\n```bash\ntex-minify minify INPUT_FILE [-o OUTPUT] [--base-dir BASE_DIR]\n```\n\nArguments:\n- `INPUT_FILE`: Path to the input TeX file\n- `-o, --output`: Output file path (optional, defaults to stdout)\n- `--base-dir`: Base directory for resolving `\\input` paths (optional, defaults to input file directory)\n\n### filter-bib\n\nFilter a BibTeX file to only include references that are cited in the TeX file.\n\n```bash\ntex-minify filter-bib TEX_FILE BIB_FILE [-o OUTPUT]\n```\n\nArguments:\n- `TEX_FILE`: Path to the TeX file containing citations\n- `BIB_FILE`: Path to the BibTeX file to filter\n- `-o, --output`: Output file path (optional, defaults to stdout)\n\n## Error Handling\n\nThe tool will exit with a non-zero status code and display an error message if:\n- Input files are not found\n- Referenced `\\input` files are not found\n- Output file cannot be written\n- Any other processing errors occur",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A CLI tool to expand \\input commands in TeX files and filter BibTeX files based on citations.",
    "version": "0.2.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/yourusername/tex-minify/issues",
        "Homepage": "https://github.com/yourusername/tex-minify",
        "Repository": "https://github.com/yourusername/tex-minify.git"
    },
    "split_keywords": [
        "cli",
        " latex",
        " preprocessor",
        " tex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "facbba8bf627b0a926dcb6b0e9ed2abeb8ab9e3cd16fb510ce0d0d655c8ba2e4",
                "md5": "d6c14ade83a6e5e8aa00329a27763efb",
                "sha256": "6c7ae1d2e0610006612ed481fbbb7d5ef9d4159681b22c0af9e7549f0330ff17"
            },
            "downloads": -1,
            "filename": "tex_minify-0.2.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6c14ade83a6e5e8aa00329a27763efb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 5322,
            "upload_time": "2024-12-16T18:07:48",
            "upload_time_iso_8601": "2024-12-16T18:07:48.248841Z",
            "url": "https://files.pythonhosted.org/packages/fa/cb/ba8bf627b0a926dcb6b0e9ed2abeb8ab9e3cd16fb510ce0d0d655c8ba2e4/tex_minify-0.2.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2882cdd79978ac18b2265e370c8a3a64e6bfbb3a95ca87243001e416307ab41b",
                "md5": "4d2fd5ac2813e4a93ecb2e605b7b1dd5",
                "sha256": "2ff66f9d5b72bd06ae88e41a241e5584ac5b2b38562ba66687b6889593b10080"
            },
            "downloads": -1,
            "filename": "tex_minify-0.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "4d2fd5ac2813e4a93ecb2e605b7b1dd5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 15232,
            "upload_time": "2024-12-16T18:07:50",
            "upload_time_iso_8601": "2024-12-16T18:07:50.614322Z",
            "url": "https://files.pythonhosted.org/packages/28/82/cdd79978ac18b2265e370c8a3a64e6bfbb3a95ca87243001e416307ab41b/tex_minify-0.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 18:07:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "tex-minify",
    "github_not_found": true,
    "lcname": "tex-minify"
}
        
Elapsed time: 0.47713s