TransWikia.com

Generate cross-referencing graph

TeX - LaTeX Asked on February 23, 2021

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?

One Answer

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] &Barrow[d] &
 C arrow[r] &Darrow[r] & E
end{tikzcd}
end{document}

enter image description here

Answered by user228539 on February 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP