PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Mathematischer Ausdruck in farbiger Tabelle



Special_K
25-09-2005, 15:20
Ich habe eine farbig hinterlegte Tabelle, in der ich einen mathematischen Ausdruck setzen möchte, siehe Minimalbeispiel. Jedoch wird das erste Zeichen im Array (hier a_{11}) durch eine schwarze Box überdeckt, sodass es nicht sichtbar ist. Die Darstellung aller anderen Zeichen funktioniert normal. Wie kann ich dieses Problem beheben?


\documentclass{article}
\usepackage[table]{xcolor}

\definecolor{mygray}{gray}{.90}

\begin{document}

\begin{tabular}{l}
\rowcolor{mygray}\vspace{.5ex}
$A = \left[
\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}
\right]$
\end{tabular}

\end{document}

edico
25-09-2005, 19:44
.. ich weiss eigentlich nicht warum; aber mach es so:
...
\begin{tabular}{l}
%\rowcolor{mygray}\vspace{.5ex} % diese Zeile alleine ist buggy, stattdessen jede Zeile 'anstreichen' !
\rowcolor{red!20} $A = \left[
\begin{array}{cccc}
\rowcolor{red!20} a_{11} & a_{12} & \cdots & a_{1n}\\
\rowcolor{red!20} a_{21} & a_{22} & \cdots & a_{2n}\\
\rowcolor{red!20} \vdots & \vdots & \ddots & \vdots\\
\rowcolor{red!20} a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}
\right]$
\end{tabular}
...
edico

Special_K
26-09-2005, 09:06
Warum ist die eine Zeile buggy? Die farbige Tabelle ist Bestandteil einer eigenen Umgebung, die ich nach deinem Rat (siehe <a href="http://www.mrunix.de/forums/showthread.php?t=40751">hier</a>) erstellt habe. Normalerweise wird alles so angezeigt wie ich es will, nur mathematische arrays und andere mehrzeilige mathematische Umgebungen streiken.

edico
26-09-2005, 11:08
AFAIK 'ueberlagert' deine einspaltige tabular das 'array' mit schwarzer Farbe.
Die bisherige Loesung bezieht sich auf 'rowcolor', das zeilenweise faerbt. So ist es auch in dem macro, das du zitierst.
Anderer Loesungsansatz: 'columncolor'.
...
\begin{tabular}{l}
\multicolumn{1}{>{\color{blue}\columncolor{red!10}}l}{%
$A = \left[
\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}
\right]$
}
\end{tabular}
...
edico

P.S. ein weiterer Loesungsansatz ist natuerlich mit colorbox:
\colorbox{yellow}{%
\begin{tabular}{|lc|} \hline
oneone & onetwo \\
twoone & twotwo \\ \hline
\end{tabular}
}