我正在尝试使用给\usepackage[usenames, dvipsnames]{color}
定的包这里.我正在使用它\color{RubineRed}{NameName}
来改变文本的颜色NameName
。但是,文本的颜色没有改变。
\documentclass{beamer}
\usepackage{xcolor,colortbl}
\usepackage[usenames, dvipsnames]{color}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}
\begin{document}
\begin{frame}{Title}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|a|b|a|b|a|b|}
\hline
\rowcolor{LightCyan}
Name & Name&Name&NameName&NameName\\
\hline
\color{RubineRed}{NameName}&-&-&-&-\\
NameName&NameName B &NameName B &- &NameName B\\
NameName&NameName A&NameName A&NameName A&NameName A\\
NameName&NameName B &NameName &-&- \\
NameName&NameName C&NameName C&NameName C&-\\
NameName&-&NameName&-&-\\
NameName&-&NameName&-&\\
\hline
\end{tabular}
} % end of scope of "\resizebox" directive
\end{frame}
\end{document}
有人能帮助我了解哪里出了问题吗?
答案1
您使用颜色包过多了。通过 beamer 选项传递选项:
\documentclass[xcolor={table,dvipsnames,usenames}]{beamer}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}
\begin{document}
\begin{frame}{Title}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|a|b|a|b|a|b|}
\hline
\rowcolor{LightCyan}
Name & Name&Name&NameName&NameName\\
\hline
\color{RubineRed}{NameName}&-&-&-&-\\
NameName&NameName B &NameName B &- &NameName B\\
NameName&NameName A&NameName A&NameName A&NameName A\\
NameName&NameName B &NameName &-&- \\
NameName&NameName C&NameName C&NameName C&-\\
NameName&-&NameName&-&-\\
NameName&-&NameName&-&\\
\hline
\end{tabular}
} % end of scope of "\resizebox" directive
\end{frame}
\end{document}