
점선으로 된 수직선과 수평선을 그리는 방법을 알 수 없었습니다. 내 상사는 필요한 경우 다른 색상의 선을 사용할 수 있다고 말했습니다.
아래 상자를 사용하여 이를 수행할 수 있는 방법이 있습니까? 점선 대신에 더 두꺼운 파란색 선을 만들고 싶습니다.
첫 번째 상자에 대한 코드는 다음과 같습니다. 그것이 어떻게 보여야 하는지에 대한 그림은 아래와 같습니다:
\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}
답변1
멋진 @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}
답변2
두 가지 가능성에 대한 솔루션은 다음과 같습니다.
\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}
편집하다: 색상 규칙과 점선 규칙을 모두 가질 수도 있습니다.
{%
\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}
}%