Skip to content

sisl/Draftcheck.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Draftcheck.jl

Build Status Coverage Status

Draftcheck.jl checks LaTeX documents for common errors using regular expressions. It was inspired by the Python package draftcheck.

Usage

We can check a single document like this:

check("myfile.tex", "rules.jl")

By default, it will follow \input and \include links if you specify a single file. You can override this by specifying follow_links = false. If you want to specify an array of files, we can do the following:

check(["myfile1.tex", "myfile2.tex", "myfile3.tex"], "rules.jl")

By default, it will not follow links, but this can be overridden.

It will return true if all checks pass and false otherwise.

Allowed

We can specify which errors to ignore in a file called allowed.txt in the directory from which we run the check command. The file must appear identical in format to the output produced by Draftcheck.jl. One workflow is to pipe the output of Draftcheck.jl to allowed.txt and then remove any lines we want to preserve as errors.

Rules

A rule specifies a name, a regular expression, and an error message. Here is an example:

rule("url", r"(?<!\\url{)(\bhttps?://)[^\s.]+\.[-A-Za-z0-9+&@#/%?=~_|!:,.;]+", "Wrap URLs with the \\url command.")

The name is "url". See example.jl for an example set of rules.

We can ignore rules in a particular line by adding a comment that says "OK" and then the name of the rule. For example:

$1x2$ % OK times

Authors

This package is based on some code developed by Cara Ip while an intern at the Stanford Intelligent Systems Laboratory.

About

Checks LaTeX documents for common errors using regular expressions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published