너무 많은 색상을 사용하지 않기 위해 비머의 색상을 사용하여 텍스트 항목을 강조합니다. 다음과 같이 보입니다.
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Madrid}
\newcommand{\gn}[1]{\textcolor{block title example.bg}{{}#1{}}}
\begin{document}
\begin{frame}{Green text}
\gn{This isn't working.}
\begin{example}[boring example]
nothing to see here.
\end{example}
\gn{This is green.}
This is black.
\end{frame}
\end{document}
이제 비머가 처음으로 색상을 사용하기 전에 해당 색상을 사용하려고 하면(예: "작동하지 않습니다") 오류가 발생합니다.
Package xcolor Error: Undefined color `block title example.bg'.
이 문제를 해결할 방법이 있나요?
답변1
\usebeamercolor[bg]{block title example}
색상을 사용할 것입니다
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Madrid}
\newcommand{\gn}[1]{{\usebeamercolor[bg]{block title example}#1}}
\begin{document}
\begin{frame}{Green text}
\gn{This isn't working.}
\begin{example}[boring example]
nothing to see here.
\end{example}
\gn{This is green.}
This is black.
\end{frame}
\end{document}