# how to center equations in parentheses

this is what I have:

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


wondering how I can obtain this:

thanks much

• \cos not \ cos then use \begin{pmatrix} not split – David Carlisle Apr 5 '17 at 16:41

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}
$$p(0) = C_h + \begin{pmatrix} R_{h}\cos\psi_{h}\\ R_{h}\sin\psi_{h}\\ 0 \end{pmatrix}$$
\end{document}


with the following result:

• 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}
$$\mathbf{p}(0) = \mathbf{c}_h + \begin{pmatrix} R_{h}\cos\psi_{h}\\ R_{h}\sin\psi_{h}\\ 0 \end{pmatrix}$$
\end{document}


which produces:

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:

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.

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