I'm trying, without success, to separate a column or a row inside a matrix. What should I do in order to get the matrix in the picture?
Asked
Active
Viewed 810 times
3 Answers
2
Among many possibilities, here is an example with use of the nicematrix package:
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\[
\begin{bNiceArrayC}{CCC|C}
a_{11} & \cdots & a_{1n} & b_1 \\
\vdots & \ddots & \vdots & \vdots \\
a_{n1} & \cdots & a_{nn} & b_n \\
\end{bNiceArrayC}
\]
\end{document}
Zarko
- 296,517
2
I would do it with an array nested in a pmatrix:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathtools, bigstrut}
\begin{document}%
\[ \begin{bmatrix}
\begin{array}{@{}cccc|c@{}}
a_{11}&a_{12}& \cdots &a_{1n} & b_1 \bigstrut[t] \\
\vdots & \vdots & \ddots& \vdots & \vdots \\
a_{m1}&a_{n2}& \cdots &a_{mn} & b_n \bigstrut[b]
\end{array}\end{bmatrix} \]
\end{document}
Bernard
- 271,350
0
Also, a plain array:
\documentclass{article}
\begin{document}
\[
\left[\begin{array}{@{}ccc|c@{}}
a_{11} & \cdots & a_{1n} & b_1 \\
\vdots & \ddots & \vdots & \vdots \\
a_{n1} & \cdots & a_{nn} & b_n \\
\end{array}\right]
\]
\end{document}
AboAmmar
- 46,352
- 4
- 58
- 127
-
I won't prefer this suggestion, as if the user missed to give @{} then some extra space added.... – MadyYuvi May 28 '19 at 04:29
-
Preference is subjective, what you prefer may not be what others prefer, and that is okay. Adding
@{}is not a big deal, see Bernard's answer and other answers by top users of this site. – AboAmmar May 28 '19 at 14:52




nicematrix, it is very good. – Sebastiano May 28 '19 at 07:42