# How to control the height of square brackets of matrix

Here is my code for creating a matrix:

$$\left [ \begin{array}{ccc} 1 & 2 & 3\\ 1 & 2 & 3\\ 1 & 2 & 3\\ \end{array} \right ]$$

In my Tex release, it is printed as

But when I edit the same code in Mathematics Stack Exchange, it appears as

So how to fit the length of square brackets to actual size of matrix? Furthermore, I found the same problem when using following environment:

\begin{bmatrix}
...
\end{bmatrix}

Can anyone help out?

• Welcome to TeX.SE! Mathematics Stack Exchange uses MathJax to typeset formulas, but MathJax is not latex.MathJay does only know a few LaTeX commands and MathJax does not use LaTeX to write formulas. Therefore the differences ... – Mensch Mar 3 at 3:19
• In your LaTeX document, do you by any chance modify a low-level parameter such as \baselinestretch or \arraystretch? Or do you load the setspace package? Please advise. – Mico Mar 3 at 7:47
• please always show a complete small document that shows the problem, not just a fragment. The spacing is affected by settings you have not shown. – David Carlisle Mar 3 at 8:13
• @Mico Sorry, I am really a newbie to Latex. I am using a complex template in which I cannot determine whether any low-level parameters were modified. Basically it solved by using \setstretch{ } :) – Finley Mar 3 at 12:26