Diagrams With KaTeX

Diagrams With KaTeX

Master Tag
Tips & Tricks
Created
Jun 7, 2021 01:36 PM
How It Works
Usage
Web Tags
Layout
Design
Cover

Donate

Get Started

  • Trigger "/mathb"
\begin{CD} ...code here... \end{CD}

Commutative Diagram Arrows

@<<< left arrow
@AAA up arrow
@VVV down arrow
@. empty arrow.
@>>> right arrow
@= horizontal equals
@| vertical equals
\begin{CD} @>>> @<<< @AAA @VVV @= @| @. \end{CD}

Example

\begin{CD} 1 @<<< 2 @= 3\\ @. @| @VVV\\ @. 4 @= 5 \end{CD}

Labels

Upper
\begin{CD} \text{A} @>label>> \text{B} \end{CD}
Lower
\begin{CD} \text{A} @>>label> \text{B} \end{CD}
Left
\begin{CD} \text{A} \\@VlabelVV\\ \text{B} \end{CD}
Right
\begin{CD} \text{A} \\@VVlabelV\\ \text{B} \end{CD}

Long Label Alignment

Before
\begin{CD} 1 @>>> 2 @>\text{this is a really long label}>> 3\\ @VVV @VVV @VVV\\ 4 @>>> 5@>>> 6 \end{CD}
After
\begin{CD} 1 @>>> 2 @>\text{this is a really long label}>> 3\\ @VVV @VVV @VVV\\ 4 @>>> 5 @>{\phantom{\text{this is a really long label}}}>> 6 \end{CD}

Long Label Alignment + Label

\begin{CD} 1 @>>> 2 @>\text{this is a really long label}>> 3\\ @VVV @VVV @VVV\\ 4 @>>> 5 @>{\rlap{$\scriptstyle{\text{shorter}}$}\phantom{\text{this is a really long label}}}>> 6 \end{CD}

Note Relationship Diagram

\begin{CD} \text{High-Tier} @>\text{next entry}>> \text{Parent} @>\text{next entry}>> \text{Orphan} \\ @VrelatedVV @VrelatedVV \\ \text{Connector} @>\text{next entry}>> \text{Child}\\ @VrelatedVV \\ \text{Child}\\ \end{CD}

Array Diagram Arrows

Array Diagram

\begin{array}{ccccc} && \text{High-Tier} && \\ & \swarrow & \downarrow & \searrow & \\ \text{Connector} && \text{Child} && \text{Connector} \\ \downarrow &&&& \downarrow \\ \text{Child} &&&& \text{Child} \end{array}