2

TL; DR Is there a package that auto-generates a graph for the inference structure from a tex source file?


Writing mathematics is hard. A reason is that, while the underlying structure of the arguments is a directed graph, we are forced to write linearly. It's therefore important to separate ideas into subsections, and explain one (and only) one main point clearly.

I reckon it would be helpful for the readers to see how the arguments are knitted together. Is there any package that does this out of the box? For example, let's say I have four lemmas A, B, C, D, among which

  • A => B
  • A => C
  • (B and C) => D
  • D => E (the main theorem)

I hope to automatically generate a graph from the source file

\begin{lemma}\label{A}[A]
  ..
\end{lemma}

\begin{lemma}\label{B}[B] \ref{A} \end{lemma}

\begin{lemma}\label{C}[C] \ref{A} \end{lemma}

\begin{lemma}\label{D}[D] \ref{B}, \ref{C} \end{lemma}

\begin{theorem}\label{E}[E] \ref{D} \end{theorem}

a graph as follows (with suitable arrows..)

A ---> B

| | | | v v

C ---> D ---> E

Question Is there a package that does this out of the box?

Student
  • 205

1 Answers1

1

Yes, there are packages for that, one of them being tikz-cd.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
 A \arrow[r]\arrow[d] &B\arrow[d] &\\
 C \arrow[r] &D\arrow[r] & E\\
\end{tikzcd}
\end{document}

enter image description here

  • 1
    Thanks for the answer. But I'm really asking for a package that auto-generates the graph. I have updated my question to clarify it. – Student Nov 23 '20 at 17:44