- #1
Eclair_de_XII
- 1,083
- 91
- TL;DR Summary
- Let's say I wanted to write out a calculation that required some steps that I wanted to write out on the right-side of each equation in an align environment. How would I accomplish this?
Let's say I wanted to describe the first step of this calculation by writing "Factor out ##c_2c_3,c_3,c_3## from these determinant expansions." on the right side of the second expression on the right. Which environment would work well?
![Untitled.png Untitled.png](https://www.physicsforums.com/data/attachments/244/244458-735de4dece364db9ea4a80705ad3a7c8.jpg)
Below is the code generating the text in the image above.
Also, I want to color some of these columns. I found an article relating to this, but I am most confused about the syntax, and how to implement it into my code.
https://tex.stackexchange.com/questions/69713/matrix-change-row-or-column-background
![Untitled.png Untitled.png](https://www.physicsforums.com/data/attachments/244/244458-735de4dece364db9ea4a80705ad3a7c8.jpg)
Below is the code generating the text in the image above.
Code:
\documentclass{article}
\usepackage{mathtools}
\newcommand{\sn}[1]{s_#1}
\newcommand{\cs}[1]{c_#1}
\begin{document}
\begin{align*}
r^{-3}\det[c'] &=&% First line.
-\sn{3} \det
\begin{pmatrix}
-\sn{1} \cs{2} \cs{3} & -\cs{1} \sn{2} \cs{3} & -\cs{1} \cs{2} \sn{3} \\
\cs{1} \cs{2} \cs{3} & -\sn{1} \sn{2} \cs{3} & -\sn{1} \cs{2} \sn{3} \\
0 & \cs{2} \cs{3} & -\sn{2} \sn{3}
\end{pmatrix}
\\[6pt]&+&
\cs{3} \det
\begin{pmatrix}
\cs{1} \cs{2} \cs{3} & -\sn{1} \cs{2} \cs{3} & -\cs{1} \sn{2} \cs{3} \\
\sn{1} \cs{2} \cs{3} & \cs{1} \cs{2} \cs{3} & -\sn{1} \sn{2} \cs{3} \\
\sn{2} \cs{3} & 0 & \cs{2} \cs{3}
\end{pmatrix}\\[6pt]&=&% Second line.
\cs{2} \sn{3}^2 \cs{3}^2 \det
\begin{pmatrix}
-\sn{1} & -\cs{1} \sn{2} & \cs{1} \cs{2} \\
\cs{1} & -\sn{1} \sn{2} & \sn{1} \cs{2} \\
0 & \cs{2} & \sn{2}
\end{pmatrix}\\[6pt]&+&
\cs{2} \cs{3}^4 \det
\begin{pmatrix}
\cs{1} \cs{2} & -\sn{1} & -\cs{1} \sn{2} \\
\sn{1} \cs{2} & \cs{1} & -\sn{1} \sn{2} \\
\sn{2} & 0 & \cs{2}
\end{pmatrix}\\[6pt]&=&% Third line.
\cs{2} \sn{3}^2 \cs{3}^2 \det
\begin{pmatrix}
-\sn{1} & -\cs{1} \sn{2} & \cs{1} \cs{2} \\
\cs{1} & -\sn{1} \sn{2} & \sn{1} \cs{2} \\
0 & \cs{2} & \sn{2}
\end{pmatrix}\\[6pt]&+&
\cs{2} \cs{3}^2 \cs{3}^2 \det
\begin{pmatrix}
-\sn{1} & -\cs{1} \sn{2} & \cs{1} \cs{2} \\
\cs{1} & -\sn{1} \sn{2} & \sn{1} \cs{2} \\
0 & \cs{2} & \sn{2}
\end{pmatrix}\\[6pt]&=&% Fourth line.
\cs{2} \cs{3}^2 \det
\begin{pmatrix}
-\sn{1} & -\cs{1} \sn{2} & \cs{1} \cs{2} \\
\cs{1} & -\sn{1} \sn{2} & \sn{1} \cs{2} \\
0 & \cs{2} & \sn{2}
\end{pmatrix}
\end{align*}
\end{document}
Also, I want to color some of these columns. I found an article relating to this, but I am most confused about the syntax, and how to implement it into my code.
https://tex.stackexchange.com/questions/69713/matrix-change-row-or-column-background
Last edited: