# Dealing with matrices with large symbolic expressions

I have been trying to express my matrices in a clear way. The problem I have is that the symbolic terms inside the matrices are sometime large and this kind of disturbs the matrix look of the matrix. I mean

\begin{pmatrix}
x & y
\end{pmatrix}


looks like how a matrix should. But if you have an expression there, like

\begin{pmatrix}
x + y cos(\theta) & y + x sin(\theta)
\end{pmatrix}


the matrix resembles less like a 2X1 matrix and more like two terms with a little space in between and surrounded by brackets. Is there a better command that makes matrices with reasonably large terms appear 'normal'. I can imagine my question maybe a bit unclear.

Edit: Maybe a better font for math dominated text would be better for representation? Suggestions?

• bmatrix with | in the middle ? Inline matrices are always strange to read anyways – percusse Nov 20 '16 at 20:22
• I like pmatrix in general...and it would be hard for me to change the expression everywhere now...anyways what do you mean with | in the middle? Can you give me the syntax to try out? – Zero Nov 20 '16 at 20:23
• (\begin{array}{c|c} .... \end{array}) – percusse Nov 20 '16 at 20:24
• Oh and \sin and \cos is an absolute must – Au101 Nov 20 '16 at 20:38
• @Zero \sin sir/madam, not /sin. Shouldn't be very difficult, find and replace. replace \begin{pmatrix} with \begin{bmatrix}. Same for \end – Au101 Nov 20 '16 at 20:44

## 1 Answer

I see nothing wrong with the usual typesetting: the large space between entries is sufficient. I probably would use bmatrix anyway.

You can see whether the following trick is what you need: we reduce the space around binary operation symbols.

\documentclass{article}
\usepackage{amsmath}

\newsavebox{\rpmatrixbox}
\newenvironment{rpmatrix}
{\begin{lrbox}{\rpmatrixbox}
\setlength{\medmuskip}{.5\medmuskip}%
$\begin{pmatrix}} {\end{pmatrix}$\end{lrbox}\usebox\rpmatrixbox}

\begin{document}

$\begin{pmatrix} x+y\cos(\theta) & y+x\sin(\theta)\end{pmatrix}$

\medskip

$\begin{rpmatrix} x+y\cos(\theta) & y+x\sin(\theta)\end{rpmatrix}$

\end{document} • +1. I'd be tempted to omit the parentheses around \theta, i.e., I'd write \cos\theta and \sin\theta. That way, there are no parentheses in the interior of the pmatrix environments to compete visually with the parentheses that enclose the environments. – Mico Nov 20 '16 at 21:11
• @Mico I too prefer not having them if the argument is a variable or of the form “number times variable”. – egreg Nov 20 '16 at 21:34