
Ich konnte nicht herausfinden, wie man gepunktete vertikale und horizontale Linien macht. Mein Chef sagte, dass ich bei Bedarf eine Linie in einer anderen Farbe verwenden könnte.
Gibt es eine Möglichkeit, das mit den Kästchen unten zu machen? Ich würde ihnen gerne eine dickere blaue Linie anstelle der gepunkteten Linien geben.
Hier ist mein Code für die erste Box. Unten sehen Sie, wie es aussehen soll:
\begin{center}
\begin{tabular}{|ccc|cc|c|c|}
\hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0& 5 & -1 & 0& 1 & 0 & 6 \\
\hline
3 & 7 & -8 & 0 & 0 & 1 & 9 \\
\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabular}
\end{center}
Antwort1
Eine kleine Variante der netten Antwort von @Bernard:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{bm}
\usepackage{arydshln, collcell}
\newcolumntype{C}{>{\collectcell\bm\mathsf}c<{\endcollectcell}}
\begin{document}
\[
\renewcommand\arraystretch{1.5}
\begin{array}{|CCC|CC|C:C|}
\hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0 & 5 & -1 & 0 & 1 & 0 & 6 \\
\hdashline
3 & 7 & -8 & 0 & 0 & 1 & 9 \\
\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{array}
\]
\[
\renewcommand\arraystretch{1.5}
\begin{array}{|CCC|CC|C!{\color{blue}\vline}C|}
\hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0 & 5 & -1 & 0 & 1 & 0 & 6 \\
\arrayrulecolor{red}\hline\arrayrulecolor{black}
3 & 7 & -8 & 0 & 0 & 1 & 9 \\
\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{array}
\]
\end{document}
Antwort2
Hier ist eine Lösung für beide Möglichkeiten:
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{amssymb, mathtools}
\usepackage[table, svgnames]{xcolor}
\usepackage{arydshln}
\setlength\dashlinedash{3pt}
\setlength\dashlinegap{2pt}
\begin{document}
\begin{center}
\sffamily\bfseries\setlength{\extrarowheight}{2pt}
\begin{tabular}{|ccc|cc:c|c|}
\hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0& 5 & --1 & 0& 1 & 0 & 6 \\
\hdashline
3 & 7 & --8 & 0 & 0 & 1 & 9 \\
\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabular}
\vskip 1cm
\begin{tabular}{|ccc|cc|c!{\color{Gold}\vrule}c|}
\hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0& 5 & --1 & 0& 1 & 0 & 6 \\
\arrayrulecolor{IndianRed}\hline
3 & 7 & --8 & 0 & 0 & 1 & 9 \\
\arrayrulecolor{black}\hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabular}
\end{center}
\end{document}
Bearbeiten: Sie können sogar beides haben: farbige und gestrichelte Regeln:
{%
\arrayrulecolor{IndianRed}
\begin{tabular}{!{\color{black}\vrule}ccc!{\color{black}\vrule}cc:c!{\color{black}\vrule}c!{\color{black}\vrule}}
\arrayrulecolor{black} \hline
2 & 1 & 4 & 1 & 0 & 0 & 10 \\
0& 5 & --1 & 0& 1 & 0 & 6 \\
\arrayrulecolor{Gold} \hdashline
3 & 7 & --8 & 0 & 0 & 1 & 9 \\
\arrayrulecolor{black} \hline
0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
\end{tabular}
}%