Skip to main content

Extract sections from TeX and create TeX documents.

Project description

TeX Extractor

A CLI tool to extract specific sections from a TeX document and format them as a new document.

Example Use Case

Let's say we have taken notes for a particular subject in a document measure-theory/measure-theory.tex. You may want to revise all of the definitions for the course, so you can run

texextract measure-theory measure-definitions --section definition --title "Measure Theory Definitions"

This will output a document measure-definitions/measure-definitions.tex which contains only the definitions.

You can specify multiple sections, e.g.

texextract measure-theory measure-theorems --section theorem --section lemma --section proposition --title "Measure Theory Theorems"

API Reference

╰─❯ texextract --help

 Usage: texextract [OPTIONS] [INPUT] [OUTPUT]

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────╮
│   input       [INPUT]   Path to input .tex file or to its parent folder                       │
│   output      [OUTPUT]  Output file path. This can be a path to a .tex file, or a folder      │
│                         name. The output is a folder unless --file-only is passed.            │
╰───────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────╮
│ --title               -t      TEXT  If given, overrides the title of the input document.      │
│ --author              -a      TEXT  If given, overrides the author of the input document.     │
│ --section             -s      TEXT  Name of the environment to be picked out. Can be given    │
│                                     multiple times.                                           │
│ --file-only           -F            The output .tex file is not wrapped in a folder.          │
│ --strict              -S            Do not tolerate invalid .tex input.                       │
│ --force               -f            Ovewrite an existing .tex file.                           │
│ --install-completion                Install completion for the current shell.                 │
│ --show-completion                   Show completion for the current shell, to copy it or      │
│                                     customize the installation.                               │
│ --help                              Show this message and exit.                               │
╰───────────────────────────────────────────────────────────────────────────────────────────────╯

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

tex_extractor-1.0.1.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

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

tex_extractor-1.0.1-py2.py3-none-any.whl (31.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tex_extractor-1.0.1.tar.gz.

File metadata

  • Download URL: tex_extractor-1.0.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tex_extractor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2c369b64af3f7710139814704b90fc37a455748a1779d165b73d178133a05483
MD5 5120d73445dd3b72e49a6a2584a6843d
BLAKE2b-256 f2791217f22cf5854c144ab0e089a0df444c583b769b4178a1b8b07ea0c7fa18

See more details on using hashes here.

File details

Details for the file tex_extractor-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: tex_extractor-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tex_extractor-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 241cab44fe2f732c45f03a584aadadabf462b03b44b916dc652c243250334865
MD5 2a084ff8a05e4363c9a12743524981f0
BLAKE2b-256 30393450124c73bf5997889eb05d7c543fb30cdc83289565d4432a32a2295857

See more details on using hashes here.

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