holdenlee / depgraph

Draw dependency graphs for math theorems
MIT License
7 stars 3 forks source link

Usage

Create a file input.txt containing what you want to be read as

In the below, we will write thm, proof, label, and ref to stand in for any word in one of the 4 lists above.

Note that the program cannot read "\input..." so if your file main.tex inputs ch1.tex, ch2.tex, and ch3.tex, you should list ch1.tex, ch2.tex, and ch3.tex under Files.

Run

./depgraph input.txt output.dot
dot.exe -Tpdf output.dot > output.pdf

to make the pdf. (You must have dot installed: http://www.graphviz.org/. Make sure dot.exe is on your file path.) See dot documentation for alternate options in making the graph from the dot file.

For convenience, the above two lines are in the script "dep". You can run the above more simply as

./ dep input output

If no arguments are given, it will default to "input" and "output".

What it does

Depgraph reads the files in order.

then depgraph creates a node, internally labeled as thm:1, showing up as "Theorem 1" in the diagram.

Note depgraph does not use a full-power LaTeX parser, so many things can confuse it.

If you want theorems to not show up or be referenced, then in LaTeX define alternate versions of thm, ref, etc. that do the same thing, and don't add them to input.txt.

Todo

Smart parsing

Display

More options

See also http://thmlink.blogspot.com/.