3

this is what I have:

\begin{equation}
p(0) = C_h + \left(
\begin{split}
R_h \ cos \ \psi_h\\
R_h \ sin \ \psi_h \\
0 
\end{split}
\right)
\end{equation}

equation

wondering how I can obtain this:equation1

thanks much

1
  • 5
    \cos not \ cos then use \begin{pmatrix} not split Apr 5, 2017 at 16:41

1 Answer 1

5

As DavidCarlisle suggested, I would use the pmatrix environment of the amsmath package.

Your example can be translated into this:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
p(0) = C_h + 
\begin{pmatrix}
R_{h}\cos\psi_{h}\\
R_{h}\sin\psi_{h}\\
0
\end{pmatrix}
\end{equation}
\end{document}

with the following result:

enter image description here

Please mind that:

  • I've rewritten the correct math operators \sin and \cos
  • I've removed the extra spaces \␣ you had inserted, since the correct operators will handle the spaces well

In case you want what you've inserted (very small) below (i.e. with bold math symbols) you should use the \mathbf command, as shown below

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\mathbf{p}(0) = \mathbf{c}_h + 
\begin{pmatrix}
R_{h}\cos\psi_{h}\\
R_{h}\sin\psi_{h}\\
0
\end{pmatrix}
\end{equation}
\end{document}

which produces:

enter image description here

Not recommending this last part, included just for completeness sake

Finally, if you want your matrix to be typeset in text, and obtain the smaller matrix you posted (assuming the scaling is correct), you should use \psmallmatrix, provided by the mathtools package as such:

 \documentclass{article}
 \usepackage{mathtools}
 \begin{document}
 test text, $\mathbf{r}(0) = \mathbf{c}_h + 
 \begin{psmallmatrix}
 R_{h}\cos\psi_{h}\\
 R_{h}\sin\psi_{h}\\
 0
 \end{psmallmatrix}$
 \end{document}

(corrected as suggested by @daleif) with result:

enter image description here

Please mind that, in this case, the composition is kind of typographically ugly, since the matrix is big, and is likely to produce an asymmetry with other lines in the text flow, yielding an ugly, less legible result. Hence I don't recommend this last approach.

2
  • 2
    Btw mathtools provides a psmallmatrix env, saves a bit of typing. +1 for a good explanation
    – daleif
    Apr 5, 2017 at 20:16
  • 1
    @daleif corrected with your remark. Cheers.
    – Moriambar
    Apr 5, 2017 at 20:54

You must log in to answer this question.

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