我正在攻读图论中数学博士学位。在我的论文中,我需要在Latex表格中为特定的单元格行(图的边缘)涂色。这个可以实现吗?我只找到了一种能够给整行上色的方法。
我正在攻读图论中数学博士学位。在我的论文中,我需要在Latex表格中为特定的单元格行(图的边缘)涂色。这个可以实现吗?我只找到了一种能够给整行上色的方法。
xcolor
包中的\cellcolor
来着色特定单元格:\documentclass{standalone}
\usepackage[table]{xcolor}
\begin{document}
\begin{tabular}{r|c|l}
A & B & C \\\hline
1 & 2 & 3 \\\hline
x & y & \cellcolor{red!25}z
\end{tabular}
\end{document}
\cellcolor{red!25}\color{blue}{z}
。 - MattAllegro首先建议,如果您的表格不太大,可以手动为每个单元格中的文本上色:
\documentclass[english]{report}
\usepackage{color}
\usepackage{booktabs}
\definecolor{light-blue}{rgb}{0.6,0.6,1}
\begin{document}
\begin{table}
\begin{tabular}{lr}
\toprule
\color{red}{Some text} & \color{light-blue}{and some other}\\
\color{cyan}{inside} & \color{green}{a table}\\
\bottomrule
\end{tabular}
\end{table}
\end{document}
black
,white
,red
,green
,blue
,cyan
,magenta
,yellow
,更多详细信息请参见here。ytableau
的包。