3

From my code below, how do I:

  1. increase the spacing between the rows (as the denominator of the top fraction is too close to the numerator of the bottom fraction).

  2. reduce the spacing between the '+' signs

Here is my code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}

\begin{document}

\begin{equation}
\dfrac{d\mathbf{P}_{T}}{dt} = {\begin{pmatrix}
  \dfrac{dx}{dt} \\ \dfrac{dy}{dt} \\ \dfrac{dz}{dt}
\end{pmatrix}} ={\begin{pmatrix}
  \dfrac{dx}{d\theta_{1}} \dfrac{d\theta_{1}}{dt} & + &  \dfrac{dx}{dr_{2}} \dfrac{dr_{2}}{dt} & + & \dfrac{dx}{dr_{3}} \dfrac{dr_{3}}{dt}\\ \dfrac{dy}{d\theta_{1}} \dfrac{d\theta_{1}}{dt} & + &  \dfrac{dy}{dr_{2}} \dfrac{dr_{2}}{dt} & + & \dfrac{dy}{dr_{3}} \dfrac{dr_{3}}{dt} \\ 0 &&  0 && 0
\end{pmatrix}}
\end{equation}

\end{document}
Joe
  • 9,080

2 Answers2

3

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}

\begin{document}

\begin{equation}
\dfrac{d\mathbf{P}_{T}}{dt} = {\begin{pmatrix}
  \dfrac{dx}{dt} \\[2.5ex] 
\dfrac{dy}{dt} \\[2.5ex] 
 \dfrac{dz}{dt}
\end{pmatrix}} ={\begin{pmatrix}
  \dfrac{dx}{d\theta_{1}} \dfrac{d\theta_{1}}{dt}  +   \dfrac{dx}{dr_{2}} \dfrac{dr_{2}}{dt} + \dfrac{dx}{dr_{3}} \dfrac{dr_{3}}{dt}\\[2.5ex]
 \dfrac{dy}{d\theta_{1}} \dfrac{d\theta_{1}}{dt} +   \dfrac{dy}{dr_{2}} \dfrac{dr_{2}}{dt}  +  \dfrac{dy}{dr_{3}} \dfrac{dr_{3}}{dt} \\[2.5ex]
 0 \hspace{1.3cm} 0 \hspace{1.3cm} 0
\end{pmatrix}}
\end{equation}

\end{document}
David Carlisle
  • 757,742
3
  1. See some of the examples listed in Column and row padding in tables. I've adjusted \arraystretch below;

  2. Remove the column spacing (by setting \arraycolsep to 0pt) and then force + to be set as a binary operator using {}+{}.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \renewcommand{\arraystretch}{2}% increase spacing between rows
  \dfrac{d\mathbf{P}_{T}}{dt} = {\begin{pmatrix}
    \dfrac{dx}{dt} \\ \dfrac{dy}{dt} \\ \dfrac{dz}{dt}
  \end{pmatrix}} =
  \setlength{\arraycolsep}{0pt}% remove spacing between columns
  \begin{pmatrix}
    \dfrac{dx}{d\theta_{1}} \dfrac{d\theta_{1}}{dt} & {}+{} &  \dfrac{dx}{dr_{2}} \dfrac{dr_{2}}{dt} & {}+{} & \dfrac{dx}{dr_{3}} \dfrac{dr_{3}}{dt} \\
    \dfrac{dy}{d\theta_{1}} \dfrac{d\theta_{1}}{dt} & {}+{} &  \dfrac{dy}{dr_{2}} \dfrac{dr_{2}}{dt} & {}+{} & \dfrac{dy}{dr_{3}} \dfrac{dr_{3}}{dt} \\
    0 &&  0 && 0
  \end{pmatrix}
\end{equation}

\end{document}
Werner
  • 603,163