/latex-scanner

Scan your LaTeX sources for command invocations and missing refs.

Primary LanguageScalaGNU General Public License v2.0GPL-2.0

LaTeX Scanner

Installation

Run:

sbt stage

Usage

This gives you these executables:

CmdScanner/target/universal/stage/bin/cmdscanner
RefScanner/target/universal/stage/bin/refscanner

Which you can then call from the directory with your .tex sources. Both executables will look for .tex files in subdirectories.

CmdScanner

Find all todos:

cmdscanner todo

Find duplicate uses of \emph{}:

cmdscanner emph | sort -f | uniq -di

RefScanner

Find all \labels that you did not reference:

refscanner -c cref,Cref,ref,autoref -i commands.tex

Features

Multi-line aware

This is \emph{very
great} indeed!

\emph{very

absolutely

awesome}.

produces:

$ cmdscanner emph
very great
very absolutely awesome

Speed

It’s scanning all your .tex files in parallel, taking full advantage of your CPU cores. Which is completely irrelevant because 99% is JVM startup time. This can be alleviated by compiling to a native jvm-free image with sbt graalvm-native-image:packageBin.