TransWikia.com

Reduce a matrix to row echelon form:

TeX - LaTeX Asked by Said on July 4, 2021

How to create this matrix in latex?enter image description here

2 Answers

Since this is very quick to do (except for punching in the entries) here is a version with nicematrix. I agree with @fractal, though, that this is not the purpose of the site.

documentclass{article}
usepackage[fleqn]{amsmath}
usepackage{nicematrix}
usepackage{tikz}
usetikzlibrary{calc, fit}
begin{document}
[mathbf{B}=left[;begin{NiceArray}{cccc|c}[name=B]
    1 & 0 & 2 & 0 & -1 
    0 & 1& 0 & 3 & 4
    0 & 0& 0 & 1 & 2
    0 & 0& 0 & 0 & 0
end{NiceArray};right]
begin{tikzpicture}[remember picture, overlay,
c/.style={fit={(B-#1)},circle,draw,thick,inner sep=0.6pt,node contents={}}]
path foreach X in {1-1,2-2,3-4} {node [c=X]};
draw[very thin,gray] let p1=($(B-1-2.south west)-(B-2-1.north east)$) in
 ([xshift=-x1/2,yshift=-2*y1/3]B-1-1.south west) 
 -| ([xshift=-x1/2,yshift=-2*y1/3]B-2-2.south west)
 -| ([xshift=-x1/2,yshift=-2*y1/3]B-3-4.south west)
 -- ([xshift=x1/3,yshift=-2*y1/3]B-3-4.south east)
 ([xshift=-x1/2,yshift=-2*y1/3]B-3-5.south west)
 -- ([xshift=x1/2,yshift=-2*y1/3]B-3-5.south east);
end{tikzpicture}
]
end{document}

enter image description here

There are zillions of alternatives, some will require less packages at the expense of having less control, others will criticize the spacing here (but it is to reproduce the screen shot) and so on and so forth. The question whether such matrices really help the reader to understand what's going on is off-topic, this is merely to say that if you really need to it is easy to create such things.

Correct answer by user194703 on July 4, 2021

A solution with the new circledsteps package and hhline:

documentclass[svgnames, table]{article}
usepackage{amsmath}%
usepackage{array, hhline}
usepackage{circledsteps, tikz}
tikzset{/csteps/inner ysep=6pt, /csteps/inner xsep=6pt}

begin{document}

[
setlength{extrarowheight}{3pt}
 mathbf {B} = begin{bmatrix}begin{array}{@{}cccc|c@{}}
Circled{textbf{1}} & 0 & 2 & 0 & -1 [0.5ex]noalign{vspace*{-0.4pt}}
hhline{>{arrayrulecolor{Gainsboro}}-~>{arrayrulecolor{black}~~~}}
multicolumn{1}{@{}c!{color{Gainsboro}vrule}}{0 }& Circled{textbf{1}} &3 & 0 & 4 [0.2ex]
hhline{~>{arrayrulecolor{Gainsboro}}|--~>{arrayrulecolor{black}}~}noalign{vspace*{-0.4pt}}
0 & 0 & multicolumn{1}{c!{color{Gainsboro}vrule}}{0} & Circled{textbf{1}} &2 [0.2ex]
hhline{~~~>{arrayrulecolor{Gainsboro}}|->{arrayrulecolor{black}}|>{arrayrulecolor{Gainsboro}}-}
0 & 0 & 0 & multicolumn{1}{c!{color{black}vrule}}{0 } & 0
end{array}
end{bmatrix} ]

end{document} 

enter image description here

Answered by Bernard on July 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP