0

How can I put two copies of this tikzcd on the same line?

\[
\begin{tikzcd}[row sep=2.5em]
& \text{A} \arrow[dash]{dr}{1} \\
\text{B} \arrow[dash]{ur}{2} \arrow[dash]{rr}{3} && \text{C}
\end{tikzcd}
\]
  • If you want upright letters, you should use \mathrm{A}, rather than \text{A}. – egreg Jun 25 '18 at 21:09
4
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=2.5em]
& \text{A} \arrow[dash]{dr}{1} \\
\text{B} \arrow[dash]{ur}{2} \arrow[dash]{rr}{3} && \text{C}
\end{tikzcd}
\quad
\begin{tikzcd}[row sep=2.5em]
& \text{A} \arrow[dash]{dr}{1} \\
\text{B} \arrow[dash]{ur}{2} \arrow[dash]{rr}{3} && \text{C}
\end{tikzcd}
\]
\end{document}

enter image description here

If you have different diagrams, you may want to make use of the baseline option,

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=2.5em,baseline=(B.base)]
& \text{A} \arrow[dash]{dr}{1} & \\
|[alias=B]|\text{B} \arrow[dash]{ur}{2} \arrow[dash]{rr}{3} && \text{C}
\end{tikzcd}
\quad
\begin{tikzcd}[row sep=2.5em,baseline=(B.base)]
& \text{A} \arrow[dash]{dr}{1} &\\
|[alias=B]|\text{B} \arrow[dash]{ur}{2}
\arrow[dash]{dr}{4} \arrow[dash]{rr}{3} && \text{C} \\
& \text{D} &
\end{tikzcd}
\]
\end{document}

enter image description here

or put the diagrams in \vcenter{\hbox{...}} to vertically center them.

  • Sure! That's done. – Aleph Jun 26 '18 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.