实际上我想改变演示文稿中某一行中特定单词的颜色
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\begin{frame}
What I have here
\begin{itemize}
\item{Type A, Type B, Type B, Type D}
\scriptsize nothing was found
\item{ Type C}
\scriptsize \color{green} {a, bg4, mk1, lkt2,mm1}
\item{ Type E}
\scriptsize \color{green} {MB1}
\item{ Type A }
\scriptsize\color{green} {Redg2}
\end{itemize}
\end{frame}
\end {document}
如果我添加后这样做,\color{green}
之后所有内容都会显示为绿色。但我想例如以绿色显示 a,以红色显示 bg4,其余部分以黑色显示,然后再次以绿色显示 MB1,以红色显示 Redg2
答案1
将文本放在花括号内,以不同的颜色和/或字体大小对其进行分组{...}
:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\noindent What I have here
\begin{itemize}
\item Type A, Type B, Type B, Type D {\scriptsize nothing was found}
\item Type C {\scriptsize \color{green} a}, {\scriptsize \color{red} bg4}, {\scriptsize mk1, lkt2,mm1}
\item Type E {\scriptsize \color{green} MB1}
\item Type A Down {\scriptsize \color{red} Redg2}
\end{itemize}
\end{document}
答案2
这个怎么样:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\begin{frame}
What I have here
\begin{itemize}
\item{Type A, Type B, Type B, Type D}
\scriptsize nothing was found
\item{Type C}
\scriptsize {\color{green}{a}}, {\color{red}{bg4}}, mk1, lkt2, mm1
\item{Type E}
\scriptsize {\color{green}{MB1}}
\item{Type A Down }
\scriptsize {\color{red}{Redg2}}
\end{itemize}
\end{frame}
\end{document}
下次请提供一个完整的最小示例。您已经问了足够多的问题,您应该知道这一点。