General ⇒ How do I make a matrix(4x4) with a square bracket
How do I make a matrix(4x4) with a square bracket
How do I make a matrix(4x4) with a square bracket? Like the picture I attached.
- Attachments
-
- matrix(4x4)
- matrix.JPG (12.32 KiB) Viewed 46273 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How do I make a matrix(4x4) with a square bracket
The picture does not show a matrix with a square bracket (box bracket), but with a round bracket (parenthesis) [1]. So, you should make clear which version you want. Both versions can be realised with the amsmath package.
[1] Bracket - Wikipedia, the free encyclopedia
Best regards
Thorsten¹
[1] Bracket - Wikipedia, the free encyclopedia
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How do I make a matrix(4x4) with a square bracket
Easy.
You can choose your bracket type by simply changing the symbol after the \left and \right commands.
Code: Select all
$\left[\begin{array}{cccc}
w1 & w2 & w3 & w4 \\
x1 & x2 & x3 & x4 \\
y1 & y2 & y3 & y4 \\
z1 & z2 & z3 & z4
\end{array}\right]$
TeXnicCenter 1RC, LEd 0.53, MikTeX 2.8, Windows XP (SP3)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How do I make a matrix(4x4) with a square bracket
The amsmath package offers the much easier way with the bmatrix and the pmatrix environment.FrankZA wrote:Easy. [...] You can choose your bracket type by simply changing the symbol after the \left and \right commands.
Code: Select all
\[
\begin{bmatrix}
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{bmatrix}
\]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How do I make a matrix(4x4) with a square bracket
Using the \left and \right commands allows you to choose different "boundaries". For example when creating a conditional equation:
But I suppose that is a completely different problem.
Code: Select all
$\left|x\right| = \left\{\begin{array}{cl}
x & \textrm{if}\ x \geq 0\\
-x & \textrm{if}\ x < 0
\end{array}\right.$
Last edited by FrankZA on Fri Jun 27, 2008 10:18 am, edited 1 time in total.
TeXnicCenter 1RC, LEd 0.53, MikTeX 2.8, Windows XP (SP3)
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How do I make a matrix(4x4) with a square bracket
For this issue the (preferably to use) amsmath package offers the cases environment.FrankZA wrote:Using the \left and \right commands allows you to choose different "boundaries". For example when creating a conditional equation: [...] But I suppose that is a completely different problem.
Code: Select all
\[
y=
\begin{cases}
x & \text{if}\quad y \geq 0 \\
-x & \text{if}\quad y < 0
\end{cases}
\]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: How do I make a matrix(4x4) with a square bracket
Cool, will have to look into it.
TeXnicCenter 1RC, LEd 0.53, MikTeX 2.8, Windows XP (SP3)