Here is my code for creating a matrix:

        \left [
        1 & 2 & 3\\
        1 & 2 & 3\\
        1 & 2 & 3\\
        \right ]

In my Tex release, it is printed as
enter image description here

But when I edit the same code in Mathematics Stack Exchange, it appears as
enter image description here

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


Can anyone help out?

  • 5
    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
  • 1
    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
  • 2
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.