I have a paper that uses \label for naming theorems, propositions and etc.

We say that a theorem, proposition and etc X depends on the theorem, proposition and etc Y if Y is mentioned in the closest proof environment that goes right after X.

I wonder if there exists a tool that takes my .tex source and builds a graph of dependencies between theorems, proposition and etc.

EDIT. Requested by Andrew

Here is a working example



\newenvironment{proof}{\par $\triangleleft$}{$\triangleright$}

bla bla follows from bla

bla bla bla follows from bla bla
\begin{proof} Apply \ref{Prop1}, the rest is clear

\begin{remark}\label{Rem1} % remarks have no proofs, so they shouldn't be parsed
\ref{Prop2} is harder than \ref{Prop1}.


The output should be in format of Graphviz (or anything else publicly avaliable).

  • Cross-referencing is much more overloaded term than the desription I gave above. I don't understand what you mean.
    – Norbert
    Aug 26, 2014 at 21:50
  • 2
    I understand what do you want. AFAIK, there's no such tool.
    – yo'
    Aug 26, 2014 at 21:53
  • Although I don't know of a tool for doing this I think that it would be fairly straightforward using the datatool package. Can you please add a full minimal working example with some mock theorems and references together with the expected output -- do you want a graph, a list, a table...? Adding this information would make it much easier for people to help you. If no one else provides an answer I'll try in a few days when I have time.
    – user30471
    Aug 26, 2014 at 22:21
  • @Andrew, thank you! See edits to my question.
    – Norbert
    Aug 26, 2014 at 22:39
  • 1
    @SvendTveskæg, if it bothers you so much just close this tab.
    – Norbert
    Aug 26, 2014 at 23:31


Browse other questions tagged or ask your own question.