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}
  • There is no need to add braces around \begin{pmatrix} and \end{pmatrix}. – egreg Oct 7 '15 at 20:46
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}
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}

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.