4

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

\documentclass[12pt]{article}
\usepackage[left=2cm,right=2cm,
top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage{amssymb,amsmath}
\usepackage[utf8]{inputenc} 
\usepackage[matrix,arrow,curve]{xy}
\usepackage[russian]{babel} 
\usepackage[final]{graphicx} 
\usepackage{mathrsfs}


\newtheorem{theorem}{Theorem}[subsection]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}

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



\begin{document}
\begin{proposition}\label{Prop1}
bla bla follows from bla
\end{proposition}
\begin{proof}
Obvious.
\end{proof}

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

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

\end{document}

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

marked as duplicate by michal.h21, Claudio Fiandrino, user31729, user13907, yo' Aug 27 '14 at 7:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Cross-referencing is much more overloaded term than the desription I gave above. I don't understand what you mean. – Norbert Aug 26 '14 at 21:50
  • 2
    I understand what do you want. AFAIK, there's no such tool. – yo' Aug 26 '14 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. – Andrew Aug 26 '14 at 22:21
  • @Andrew, thank you! See edits to my question. – Norbert Aug 26 '14 at 22:39
  • 1
    @SvendTveskæg, if it bothers you so much just close this tab. – Norbert Aug 26 '14 at 23:31