2

The bottom-left and bottom-right expressions don't need to be so far apart. Can I make them sit closer together? I guess that means making the outer columns overlap the middle column.

Code

\documentclass{article}
\usepackage{tikz-cd, amsmath}
\begin{document}
    \begin{tikzcd}
        & x_1 + \frac{a_{12}}{a_{11}}x_2 + \frac{a_{13}}{a_{11}}x_3 \arrow[equals, d] \\
        & 0 \arrow[equals, ld] \arrow[equals, rd] & \\
        x_1 + \frac{a_{22}}{a_{21}}x_2 + \frac{a_{23}}{a_{21}}x_3 & & x_1 + \frac{a_{32}}{a_{32}}x_2 + \frac{a_{33}}{a_{31}}x_3
    \end{tikzcd}
\end{document}

enter image description here

2 Answers 2

4

Is this better?

\documentclass{article}
\usepackage{tikz-cd, amsmath}

\begin{document}

    \begin{tikzcd}[column sep=-3em]
        & x_1 + \frac{a_{12}}{a_{11}}x_2 + \frac{a_{13}}{a_{11}}x_3 \arrow[equals, d] \\
        & 0 \arrow[equals, ld] \arrow[equals, rd] & \\
        x_1 + \frac{a_{22}}{a_{21}}x_2 + \frac{a_{23}}{a_{21}}x_3 & & x_1 + \frac{a_{32}}{a_{32}}x_2 + \frac{a_{33}}{a_{31}}x_3
    \end{tikzcd}

\end{document} 

enter image description here

1
  • Yes, I think that's it, thanks.
    – mjc
    Commented Mar 10, 2021 at 20:27
3

As an alternative to @Bernard's solution, you could enclose the top entry in \mathclap to eliminate its width. Note: \mathclap requires the mathtools package, which you can use in place of amsmath.

enter image description here

This has the advantage of only eliminating the width of specific entries without adjusting the column spacing of the diagram as a whole.

You could reduce the column sep value as well if you desire. In addition, you could enclose part of an expression in \mathllap (overlap left) or \mathrlap (overlap right):

x_1 + \frac{a_{22}}{a_{21}}x_2 + \mathrlap{\frac{a_{23}}{a_{21}}x_3}

Here is the code:

\documentclass{article}
\usepackage{tikz-cd, mathtools}
\begin{document}
    \begin{tikzcd}
        & \mathclap{x_1 + \frac{a_{12}}{a_{11}}x_2 + \frac{a_{13}}{a_{11}}x_3} \arrow[equals, d] \\
        & 0 \arrow[equals, ld] \arrow[equals, rd] & \\
        x_1 + \frac{a_{22}}{a_{21}}x_2 + \frac{a_{23}}{a_{21}}x_3 & & x_1 + \frac{a_{32}}{a_{32}}x_2 + \frac{a_{33}}{a_{31}}x_3
    \end{tikzcd}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .