Below it is a very useful command to create a matrix. But it has a short point to me since it shows Parentheses not Square brackets. My question it how should I change this to show square brackets? I appreciate your answer. Thank you so much.

K =
   K_1 & 0      & 0    \\
   0   & \ddots &    0   \\
   0   & 0      & K_n    \\
   \end{pmatrix}}_{d\times M}
  • 1
    \begin{bmatrix}? – egreg Oct 4 '13 at 15:13
  • 5
    replace {pmatrix} with {bmatrix}. – barbara beeton Oct 4 '13 at 15:14

to replace parentheses around a matrix by square brackets, replace {pmatrix} with {bmatrix}.

this requires amsmath, but once you've done that, you also have

  • Bmatrix -- curly braces
  • vmatrix -- single vertical bars
  • Vmatrix -- double vertical bars

the left and right delimiters are properly spaced for the left and right positions, a nicety that isn't always automatic.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.