Math & Science ⇒ Display the determinant of a matrix with the rule of Sarrus.
Display the determinant of a matrix with the rule of Sarrus.
Good evening
I would like to realize a LaTex page with the calculation of the determinant of a matrix with the rule of Sarrus.
I found this tutorial.
https://tex.stackovernet.com/fr/q/103579
It does not work, I get lots of mistakes.
On my computer I have MikeTex.
See you soon
I would like to realize a LaTex page with the calculation of the determinant of a matrix with the rule of Sarrus.
I found this tutorial.
https://tex.stackovernet.com/fr/q/103579
It does not work, I get lots of mistakes.
On my computer I have MikeTex.
See you soon
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Display the determinant of a matrix with the rule of Sarrus.
Hi vinc,
welcome to the forum!
Stefan
welcome to the forum!
Which code exactly did you try?vinc wrote:It does not work
What mistakes? Can you tell us error messages?vinc wrote:I get lots of mistakes.
Stefan
LaTeX.org admin
Display the determinant of a matrix with the rule of Sarrus.
Good evening
here is the code
here is the image prints screen.
I can not select the lines. Method of the rule of sarrus.
A simple selection line would suffice.
Thanks for your help.
See you soon
here is the code
\usepackage[frenchb]{babel}
\usepackage{array, mathtools}
\usepackage{amsmath,amsfonts,amssymb}
\documentclass[11pt,a4paper]{scrbook}
$det(B)=
\begin{array}{|ccc|cc|}
1 & 1 & 0 & 1 & 1\\
-1 & 2 & -1 & -1 & 2\\
-1 &-1 & 3 & -1 & -1\\
\end{array}$
\end{document}
here is the image prints screen.
I can not select the lines. Method of the rule of sarrus.
A simple selection line would suffice.
Thanks for your help.
See you soon
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Display the determinant of a matrix with the rule of Sarrus.
Here is a way with TikZ:
Stefan
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\begin{document}
$\det(B) = $
\begin{tikzpicture}[baseline = (m-2-2.base) ]
\matrix (m) [matrix of math nodes,
row sep = .5em, column sep = .5em,
every node/.style = {anchor = base east}] {
\ 1 & 1 & 0 & \ 1 & 1 \\
-1 & 2 & -1 & -1 & 2 \\
-1 &-1 & 3 & -1 & -1 \\
};
\draw
(m-1-1.north west) -- ++(0em,-5em)
(m-1-4.north west) -- ++(0em,-5em)
(m-1-5.north east) -- ++(0em,-5em)
;
\draw [color = red]
(m-1-1.south east) -- (m-3-3.north west)
(m-1-2.south east) -- (m-3-4.north west)
(m-1-3.south east) -- (m-3-5.north west)
;
\draw [color = blue]
(m-1-3.south west) -- (m-3-1.north east)
(m-1-4.south west) -- (m-3-2.north east)
(m-1-5.south west) -- (m-3-3.north east)
;
\end{tikzpicture}
\end{document}
LaTeX.org admin
Display the determinant of a matrix with the rule of Sarrus.
Hello
It did not work, it looks like it is missing a package.
Here is a screenshot of the error.

Here is the code.
I took out \ he rejected them
See you soon
It did not work, it looks like it is missing a package.
Here is a screenshot of the error.

Here is the code.
\documentclass[11pt,a4paper]{scrbook}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[a4paper,pdftex,dvips]{geometry}
\usepackage[frenchb]{babel}
\usepackage{array, mathtools}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{tikz}
\usetikzlibrary{calc,matrix}
\usepackage[font={small,it}]{floatrow}
\usepackage{setspace}
\usepackage{systeme}
\usetikzlibrary{matrix,calc}
\begin{document}
$det(B)= $
\begin{tikzpicture}[baseline = (m-2-2.base) ]
matrix (m) [matrix of math nodes,
row sep = .5em, column sep = .5em,
every node/.style = {anchor = base east}] {
1&1&0&1&1 \\
-1&2&-1&-1&2 \\
-1&-1&3&-1&-1 \\
};
(m-1-1.north west) -- ++(0em,-5em)
(m-1-4.north west) -- ++(0em,-5em)
(m-1-5.north east) -- ++(0em,-5em);
draw [color = red]
(m-1-1.south east) -- (m-3-3.north west)
(m-1-2.south east) -- (m-3-4.north west)
(m-1-3.south east) -- (m-3-5.north west);
\draw [color = blue]
(m-1-3.south west) -- (m-3-1.north east)
(m-1-4.south west) -- (m-3-2.north east)
(m-1-5.south west) -- (m-3-3.north east);
\end{tikzpicture}
\end{document}
I took out \ he rejected them
See you soon
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Display the determinant of a matrix with the rule of Sarrus.
You forgot the backslash for the matrix command. Write
And remove the unnecessary empty lines in the code. Empty lines are paragraph breaks, and there should not be a paragraph break within a list of options or in the middle of a matrix.
Btw. it's nice that you provide screenshots, but can you please post them directly here? You can post images as attachments, the "Attachments" link is below the text edit field, when editing a post. See your original post above, I did it there for you, so you can see the image inline. And also btw. the "LaTeX" button is more for inline LaTeX commands, for longer code there is the "Code" button, for the editor. It looks nicer, as in my post above. Just to let you know.
Thanks!
Stefan
\matrix
instead of just matrix
.And remove the unnecessary empty lines in the code. Empty lines are paragraph breaks, and there should not be a paragraph break within a list of options or in the middle of a matrix.
Btw. it's nice that you provide screenshots, but can you please post them directly here? You can post images as attachments, the "Attachments" link is below the text edit field, when editing a post. See your original post above, I did it there for you, so you can see the image inline. And also btw. the "LaTeX" button is more for inline LaTeX commands, for longer code there is the "Code" button, for the editor. It looks nicer, as in my post above. Just to let you know.
Thanks!
Stefan
LaTeX.org admin
Display the determinant of a matrix with the rule of Sarrus.
good evening
There is one more problem.
Here is the code below.
Error on lines 49 (end{tikzpicture}).
! Missing } inserted.<inserted text>}
! Misplaced \cr.<inserted text> \cr \end{tikzpicture}
See you soon
There is one more problem.
Here is the code below.
Code: Select all
$det(B)= $
\begin{tikzpicture}[baseline = (m-2-2.base) ]
\matrix (m) [matrix of math nodes,
row sep = .5em, column sep = .5em,
every node/.style = {anchor = base east}] {
1&1&0&1&1 \\
-1&2&-1&-1&2 \\
-1&-1&3&-1&-1 \\
};
(m-1-1.north west) -- ++(0em,-5em)
(m-1-4.north west) -- ++(0em,-5em)
; (m-1-5.north east) -- ++(0em,-5em)
draw [color = red]
(m-1-1.south east) -- (m-3-3.north west)
(m-1-2.south east) -- (m-3-4.north west)
(m-1-3.south east) -- (m-3-5.north west)
;
\draw [color = blue]
(m-1-3.south west) -- (m-3-1.north east)
(m-1-4.south west) -- (m-3-2.north east)
(m-1-5.south west) -- (m-3-3.north east)
;
\end{tikzpicture}
! Missing } inserted.<inserted text>}
! Misplaced \cr.<inserted text> \cr \end{tikzpicture}
See you soon
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Display the determinant of a matrix with the rule of Sarrus.
It is caused by the paragraph break within the matrix, by that empty line.
Stefan
Stefan
LaTeX.org admin
Display the determinant of a matrix with the rule of Sarrus.
good evening
I almost arrived there, it misses the lines of the table.
Here is the screen print.
Thank you !
See you soon
I almost arrived there, it misses the lines of the table.
Code: Select all
$det(B)=$
\begin{tikzpicture}[baseline = (m-2-2.base)]
\matrix (m) [matrix of math nodes,
row sep = .5em, column sep = .5em,
every node/.style = {anchor = base east}] {
\ 1 & 1 & 0 & \ 1 & 1 \\
-1 & 2 &-1 &- 1 & 2 \\
-1 &-1 & 3 & 1 &-1 \\};
(m-1-1.north west) -- ++(0em,-5em)
(m-1-4.north west) -- ++(0em,-5em)
(m-1-5.north east) -- ++(0em,-5em);
\draw [color = red]
(m-1-1.south east) -- (m-3-3.north west)
(m-1-2.south east) -- (m-3-4.north west)
(m-1-3.south east) -- (m-3-5.north west);
\draw [color = blue]
(m-1-3.south west) -- (m-3-1.north east)
(m-1-4.south west) -- (m-3-2.north east)
(m-1-5.south west) -- (m-3-3.north east);
\end{tikzpicture}
Thank you !
See you soon
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Display the determinant of a matrix with the rule of Sarrus.
After the matrix, a \draw command is missing. I had it in the code above.
Stefan
Stefan
LaTeX.org admin