3

This is a question to Werner's answer to the question "How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?".

Consider the following code:

\documentclass{article}

\usepackage{mathtools}
\usepackage{pst-node}

\begin{document}

\begin{align*}
\begin{array}{c}
   \psDefBoxNodes{n1}{3}
  (\psDefBoxNodes{n2}{5x} +
   \psDefBoxNodes{n3}{4y} +
   \psDefBoxNodes{n4}{7z})
\end{array}
\psset{
  arrows = ->,
  nodesep = 3pt,
  arcangle = 60
}
\ncarc{n1:tC}{n2:tC}
\ncarc{n1:tC}{n3:tC}
\ncarc{n1:tC}{n4:tC}
\hspace{-0.55em} % The length is found manually but how can I make LaTeX calculate it automatically?
&= 3 \cdot 5x + 3 \cdot 4y + 3 \cdot 7z\\
&= 15x + 12y + 21z
\end{align*}

\end{document}

The question is incorporated as a comment in the code above.

1 Answers1

2

Two options:

  1. Use

    \begin{array}{c@{}}
    

    to remove the column spacing between the array and any surrounding environment. I'd actually \setlength{\arraycolsep}{0pt} instead, which would be similar to using the column specification @{}c@{}.

  2. You need to use \hspace{-\arraycolsep} or remove the column gap inserted by array.

There's not real need for using an array in your example, but that's perhaps not really a question here.

Werner
  • 603,163