beamer xcolor 和 cellcolor 的问题

beamer xcolor 和 cellcolor 的问题

我在更改 beamer 中的单元格颜色时遇到了问题。我已加载xcolorbeamer并指定了svgnamestable选项;

\documentclass[xcolor=svgnames,smaller,12pt,table]{beamer}

以下是我尝试改变投影仪中的单元格颜色的方法;

\begin{table}[H]
\centering
\caption{Summary of the differences between open and cloed word classes}

\rowcolors{2}{white}{pink!30}
\begin{tabular}{>{\centering\arraybackslash}p{5cm}>{\centering\arraybackslash}p{5cm}}
Open-class & Closed-class\\ 
\hline
\cellcolor[yellow]{0.5}Admit new members & Do not admit new members \\ 
Are numerous & Are few \\ 
Express "content" & Do not express "content" \\ 
Carry stress & Rarely carry stress \\ 
Can be long, e.g. \textit{antidisestablishmentarianism} & Tend to be short, e.g. \textit{the, on} \\
\hline
\end{tabular} 
\end{table}

我收到错误消息undefined color model。我检查了 是否yellow是 SVG 颜色,结果是 。我还定义了一个名为 的颜色模型yellow,但这也不起作用。

答案1

\cellcolor{yellow!50}

是正确的语法。我想你的意思是灰色。那么它就是

\cellcolor[gray]{0.5}

gray是颜色模型

相关内容