Skip to main content

A LaTeX change tracking tool

Project description

A LaTeX change tracking tool.

GPLv3 Licensed Releases Issues

The name

Zaphod Beeblebrox is a fictional character in the various versions of the humorous science fiction story The Hitchhiker’s Guide to the Galaxy by Douglas Adams.

The tool

A wrapper around latexdiff that recursively checks changes in LaTeX sources between two Git revisions and generates a nice annotated PDF in a new Git branch. This Git branch sits on top of the newer revision - after one has accepted/rejected changes, one can remove the annotations and simply commit and merge to the master branch - a nice workflow.

It is rather simple at the moment and probably has heaps of issues. Feel free to modify it to suit your purposes and open pull requests.

Here is a test repository with LaTeX sources and a resultant latexdiff-annotated branch to play with: https://github.com/sanjayankur31/latex-changes

Usage

usage: zaphod [-h] {revise,diff,clean} ...

positional arguments:
  {revise,diff,clean}  additional help
    revise             Interactive revision
    diff               Generate changes output
    clean              Clean up Zaphod related branches

optional arguments:
  -h, --help     View subcommand help

NOTES:
    The idea of this program is to help LaTeX users track, review, and
    see changes that have been made in their source files. The script
    only works when git is used as a version control system.

Expected workflow:
    - Make changes, commit
    - Run this program:
        It will generate a pdf with differences between the two
        provided Git revisions using latexdiff. It will also commit the
        annotated TeX sources in a new Git branch called "changes".
        - Review commits using generated PDF.
        - Accept/ignore changes.
        - Commit once finished.
        - Merge to master branch.
        - Profit.

Requires:
    - latexdiff
    - Git
    - pdflatex
    - latexmk
    - bibtex or biber
    - Python3


Subcommand: 'revise'
usage: zaphod revise [-h] [-m MAIN] [-s SUBDIR]

optional arguments:
  -h, --help            show this help message and exit
  -m MAIN, --main MAIN  Name of main file. Only used to generate final pdf
                        with changes.
                        Default: main.tex
  -s SUBDIR, --subdir SUBDIR
                        Name of subdirectory where main file resides.
                        Default: .
  -c, --citations       Document contains citations. Will run pdflatex and
                        bibtex as required. Default: False

TIP: To accept all - switch to rev2 branch/revision.
TIP: To reject all - switch to rev1 branch/revision.
Yay! Git!

Subcommand: 'diff'
usage: zaphod diff [-h] [-r REV1] [-t REV2] [-m MAIN] [-s SUBDIR] [-l LATEXDIFFOPTS] [-c]

optional arguments:
  -h, --help            show this help message and exit
  -r REV1, --rev1 REV1  First revision to diff against
  -t REV2, --rev2 REV2  Second revision to diff with.
  -m MAIN, --main MAIN  Name of main file. Only used to generate final pdf
                        with changes. Default: main.tex

  -s SUBDIR, --subdir SUBDIR
                        Name of subdirectory where main file resides.
                        Default: .

  -l LATEXDIFFOPTS, --latexdiffopts LATEXDIFFOPTS
                        Pass options to latexdiff. Please read man
                        latexdiff for available options. These must be
                        enclosed in single quotes to ensure they are passed
                        to latexdiff without any processing.
                        Default: --type=UNDERLINE

  -c, --citations       Document contains citations. Will add -bibtex to
                        latexmk.
                        Default: True


Subcommand: 'clean'
usage: zaphod clean [-h] [-y]

optional arguments:
  -h, --help  show this help message and exit
  -y, --yes   Assume yes Please be careful when using this option. Default: False

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

zaphodtex-0.7.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

zaphodtex-0.7.0-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file zaphodtex-0.7.0.tar.gz.

File metadata

  • Download URL: zaphodtex-0.7.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for zaphodtex-0.7.0.tar.gz
Algorithm Hash digest
SHA256 cdecb122a078f17a4cdf13a9264c956c4970f3bc62efddfd14f8bded95702ee6
MD5 873e9a694ef5486ff839eb62888cd13d
BLAKE2b-256 9c98b5588753bd801e922a14c0a64c10257b00fb3c0fdc288a56df096f136723

See more details on using hashes here.

File details

Details for the file zaphodtex-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: zaphodtex-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for zaphodtex-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3731335ea2955bebdff8a34a0568fb24a4cca482454313778a46b2d7cd9c4fbf
MD5 be95f27d002ad9cda918205d912f69bf
BLAKE2b-256 ffbef1d0c70d28db92a393d4f969f5a6d7578c3ea6f1dc4e5b41b039faf1b4d2

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