Math & Science ⇒ Rule of Sarrus
Rule of Sarrus
Thanks in advance and greetings
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rule of Sarrus
Code: Select all
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{calc,matrix}
\begin{document}
\begin{tikzpicture}
\matrix [%
matrix of math nodes,
column sep=1em,
row sep=1em
] (sarrus) {%
a_{11} & a_{12} & a_{13} & a_{11} & a_{12} \\
a_{21} & a_{22} & a_{23} & a_{21} & a_{22} \\
a_{31} & a_{32} & a_{33} & a_{31} & a_{32} \\
};
\path ($(sarrus-1-3.north east)+(0.5em,0)$) edge[dotted] ($(sarrus-3-3.south east)+(0.5em,0)$)
(sarrus-1-1) edge (sarrus-2-2)
(sarrus-2-2) edge (sarrus-3-3)
(sarrus-1-2) edge (sarrus-2-3)
(sarrus-2-3) edge (sarrus-3-4)
(sarrus-1-3) edge (sarrus-2-4)
(sarrus-2-4) edge (sarrus-3-5)
(sarrus-3-1) edge[dashed] (sarrus-2-2)
(sarrus-2-2) edge[dashed] (sarrus-1-3)
(sarrus-3-2) edge[dashed] (sarrus-2-3)
(sarrus-2-3) edge[dashed] (sarrus-1-4)
(sarrus-3-3) edge[dashed] (sarrus-2-4)
(sarrus-2-4) edge[dashed] (sarrus-1-5);
\foreach \c in {1,2,3} {\node[anchor=south] at (sarrus-1-\c.north) {$+$};};
\foreach \c in {1,2,3} {\node[anchor=north] at (sarrus-3-\c.south) {$-$};};
\end{tikzpicture}
\end{document}
[1] Rule of Sarrus — Wikipedia, the free encyclopedia
Best regards and welcome to the board
Thorsten
- Attachments
-
- Rendered output of the given code.
- Sarrus.png (8.52 KiB) Viewed 13298 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Rule of Sarrus
However, when trying to run it I get the message
Code: Select all
l.3 \usetikzlibrary{calc,matrix}
Please type another input file name:
I am not so skilled in Latex and am not sure how to ommit it.
Best, and thanks.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: Rule of Sarrus
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Rule of Sarrus
Stefan
Re: Rule of Sarrus
I noticed that I didn't have PGF/TikZ installed on my Mac at all. I downloaded version 2.10 but here is no information what so ever how to install it or were to put the files. As soon as I solve this problem I will check the code from Thorsten. If you have an idea how to handle the installation, please advice (I use TexShop)
All the best.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rule of Sarrus
I guess that the TeX Live Utility will be very helpful in this regard. I don't know how to get it. Perhaps it is already installed with MacTeX.Math12345 wrote:[…] If you have an idea how to handle the installation, please advice (I use TexShop) […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Rule of Sarrus
Code: Select all
sudo tlmgr install pgf
Re: Rule of Sarrus
I'd like to say THANK YOU to all wonderful contributors!
