![改变投影仪中单词的颜色](https://linux22.com/image/354349/%E6%94%B9%E5%8F%98%E6%8A%95%E5%BD%B1%E4%BB%AA%E4%B8%AD%E5%8D%95%E8%AF%8D%E7%9A%84%E9%A2%9C%E8%89%B2.png)
我有以下 MWE
\documentclass[xcolor=pdftex,t,11pt]{beamer}
\definecolor{unime}{rgb}{0.77,0.12,0.23}
\setbeamercolor{section in toc}{fg=unime}
\setbeamercolor{alerted text}{fg=unime}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{tikz}
\newcommand\mybox[2][]{\tikz[overlay]\node[fill=unime!20,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}}
\setbeamercolor{button}{bg=unime,fg=white}
\newenvironment{stepenumerate}{\begin{enumerate}[<+->]}{\end{enumerate}}
\newenvironment{stepitemize}{\begin{itemize}[<+->]}{\end{itemize} }
\newenvironment{stepenumeratewithalert}{\begin{enumerate}[<+-| alert@+>]}{\end{enumerate}}
\newenvironment{stepitemizewithalert}{\begin{itemize}[<+-| alert@+>]}{\end{itemize} }
\begin{document}
\section{Basic data analysis in STATA}
\subsection{Making graphs}
\begin{frame}
\frametitle{Basic data analysis in STATA}
\framesubtitle{Making graphs}
\begin{stepitemizewithalert}
\item STATA allows you to draw simple as well as sophisticated graphs. \medskip
\item In most cases, we need very simple graphs in order to establish a correlation between variables.\medskip
\item Before we start we need to assemble our dataset. We want to collect information about US monetary policy, as well as its GDP, consumer price index and stock market price.\medskip
\item We use the dataset AFE1 and it can be download from my website. \medskip
\item The data cover the period 1990 to 2010 and has been downloaded from \mybox[fill=unime]{\href{https://fred.stlouisfed.org/}{\textbf{\textit {FRED}}}} website, which is the FED data archive.\medskip
\end{stepitemizewithalert}
\end{frame}
\end{document}
我使用自己的颜色 (unime),并设法在单词 FRED(其中包含指向网站的链接)周围绘制了一个框。但是,使用自己的颜色时,FRED 一词包含在框中时无法看到。我怎样才能仅更改该单词的颜色,比如说白色?
提前致谢。
答案1
使用\textcolor
\documentclass[xcolor=pdftex,t,11pt]{beamer}
\definecolor{unime}{rgb}{0.77,0.12,0.23}
\setbeamercolor{section in toc}{fg=unime}
\setbeamercolor{alerted text}{fg=unime}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{tikz}
\newcommand\mybox[2][]{\tikz[overlay]\node[fill=unime!20,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}}
\setbeamercolor{button}{bg=unime,fg=white}
\newenvironment{stepenumerate}{\begin{enumerate}[<+->]}{\end{enumerate}}
\newenvironment{stepitemize}{\begin{itemize}[<+->]}{\end{itemize} }
\newenvironment{stepenumeratewithalert}{\begin{enumerate}[<+-| alert@+>]}{\end{enumerate}}
\newenvironment{stepitemizewithalert}{\begin{itemize}[<+-| alert@+>]}{\end{itemize} }
\begin{document}
\section{Basic data analysis in STATA}
\subsection{Making graphs}
\begin{frame}
\frametitle{Basic data analysis in STATA}
\framesubtitle{Making graphs}
\begin{stepitemizewithalert}
\item STATA allows you to draw simple as well as sophisticated graphs. \medskip
\item In most cases, we need very simple graphs in order to establish a correlation between variables.\medskip
\item Before we start we need to assemble our dataset. We want to collect information about US monetary policy, as well as its GDP, consumer price index and stock market price.\medskip
\item We use the dataset AFE1 and it can be download from my website. \medskip
\item The data cover the period 1990 to 2010 and has been downloaded from \mybox[fill=unime]{\href{https://fred.stlouisfed.org/}{\textbf{\textit{\textcolor{white}{FRED}}}}} website, which is the FED data archive.\medskip
\end{stepitemizewithalert}
\end{frame}
\end{document}