[OS X TeX] Cancelling columns?
Alain Matthes
alain.matthes at mac.com
Sat Mar 22 09:47:28 CET 2008
Le 21 mars 08 à 02:50, David Derbes a écrit :
> I apologize for what is probably a simple thing, but it's defeated
> me for a while now.
>
> I am writing a small note about calculation of determinants using
> minors. I would like to draw explicitly a line through the numbers
> of a row
not a good idea but "for me", I prefer to use boxes like below but
It' s possible to draw a line with TikZ and matrix node like you want
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (magic) [matrix of nodes]
{
8 & 1 & 6 \\
3 & 5 & 7 \\
4 & 9 & 2 \\
};
\draw[thick,red,-] (magic-1-2.north) -- (magic-3-2.south);
\end{tikzpicture}
\end{document}
> (which I think I can do with the ``soul'' package.) But how to do it
> with a column? If worse comes to worse, I can use LaTeXiT to export
> the matrix to Illustrator, draw the lines in Illustrator, and then
> use it as a graphic. But if LaTeX will do the job, I'd prefer that.
>
> Many thanks in advance,
Perhaps you can try something like the code below :
From MathMode.pdf by Herbert Voss .
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\begin{document}
\[
\left(
\begin{array}{c@{}c@{}c}
\begin{array}{|cc|}
\hline
a_{11} & a_{12} \\
a_{21} & a_{22} \\
\hline
\end{array} & 0 & 0 \\
0 & \begin{array}{|ccc|}
\hline
b_{11} & b_{12} & b_{13}\\
b_{21} & b_{22} & b_{23}\\
b_{31} & b_{32} & b_{33}\\
\hline
\end{array} & 0 \\
0 & 0 & \begin{array}{|cc|}
\hline
c_{11} & c_{12} \\
c_{21} & c_{22} \\
\hline
\end{array} \\
\end{array}
\right)
\]
\[
\overrightarrow{A}=\left[
\begin{array}{cccc}
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4\\\hline
\multicolumn{1}{|c}{1} & 2 & 3 &
\multicolumn{1}{c|}{4}\\\hline
1 & 2 & 3 & 4
\end{array}\right]
\]
\[
\overrightarrow{A}=\left[
\begin{array}{cc|c|c}\cline{3-3}
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4\\\cline{3-3}
\end{array}\right]
\]
\[
\overrightarrow{A}=\left[
\begin{array}{cc|c|c}\cline{3-3}
1 & 2 & 3 & 4\\
1 & 2 & 3 & 4\\\hline
\multicolumn{1}{|c}{1} & 2 & 3 &
\multicolumn{1}{c|}{4}\\\hline
1 & 2 & 3 & 4\\\cline{3-3}
\end{array}\right]
\]
\end{document}
Best Regards
Alain Matthes
More information about the macostex-archives
mailing list