I am typesetting my lecture notes and need to highlight some entries in the matrices, to indicate which entries I am talking about. In two out of three matrices the highlighting is exactly where it should be, but in the third the highlighting is off. The two red dots should be highlighting the 1s in the 1st and 2nd column of the third matrix.
I ran the code several times (aware that if the position of the matrices changed, it takes one more run for tex to create correct coordinates for the highlighting). I also deleted the other files (all except the .tex one) to make sure that was not what was creating a problem.
Now I don't know what else to try.
Could someone please tell me what is wrong with my code? Thanks!
\noindent\begin{minipage}{\textwidth}
\vspace{0.3cm}
\noindent\begin{minipage}[b]{.32\textwidth}
\begin{tabular}{c}
$
\begin{bmatrix}
1 & \tikzmark{notleadingone}{1} \\
0 & 1 \\
0 & 0 \\
0 & 0
\end{bmatrix} $
\begin{tikzpicture}[overlay,remember picture]
\draw[opacity=.2,line width=4mm,line cap=round,color=red] (notleadingone.center) -- (notleadingone.center);\end{tikzpicture} \\
\\
\begin{tabular}{ c }
There is a nonzero\\ entry in a column \\ of a leading 1 \\
\end{tabular}
\end{tabular}
\end{minipage}
\begin{minipage}[b]{.32\textwidth}
\begin{tabular}{c}
$\begin{bmatrix}
\tikzmark{leftzerorow}{0} & 0 & 0 & \tikzmark{rightzerorow}{0} \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0
\end{bmatrix}$ \begin{tikzpicture} [overlay,remember picture]
\draw[opacity=.2,line width=4mm,line cap=round,color=red] (leftzerorow.center) -- (rightzerorow.center);\end{tikzpicture}\\
\\
\begin{tabular}{ c }
Not all \\ zero rows\\ are at the bottom \\
\end{tabular}
\end{tabular}
\end{minipage}
\begin{minipage}[b]{.32\textwidth}
\begin{tabular}{c}
$\begin{bmatrix}
0 & 0 & 1 \\
\tikzmark{oneone}{1} & 0 & 0 \\
0 & \tikzmark{twoone}{1} & 0 \\
0 & 0 & 0
\end{bmatrix}$
\begin{tikzpicture}
\draw[opacity=.2,line width=4mm,line cap=round,color=red] (oneone.center) -- (oneone.center);
\draw[opacity=.2,line width=4mm,line cap=round,color=red] (twoone.center) -- (twoone.center);\end{tikzpicture} \\
\\
\begin{tabular}{ c }
Some leading 1s are \\not to the right from \\ the leading 1s above them \\
\end{tabular}
\end{tabular}
\end{minipage}
\end{minipage}
\documentclass{...}
and ending with\end{document}
. – Stefan Pinnow May 26 '17 at 5:27remember picture,overlay
options. – Andrew Stacey May 26 '17 at 5:37