我正在使用acronym
和mdframed
包,当我\acs{}
在里面使用时\begin{mdframed}[style=question]
,\end{mdframed}
我希望它的颜色为“白色”。如何实现?
最小示例:
\documentclass[a4paper,10pt]{article}
\usepackage{acronym}
\usepackage{hyperref}
\usepackage{wallpaper}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{acronym}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=linkcolor,
citecolor=linkcolor,
filecolor=linkcolor,
urlcolor=linkcolor
}
\usepackage{color}
\definecolor{linkcolor}{RGB}{77,152,183}
\definecolor{questioncolor}{RGB}{179,179,179}
\definecolor{wantedcolor}{RGB}{180,190,0}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{vprasanje}{%
font=\normalsize,
linecolor=questioncolor,
outerlinewidth=0pt,
roundcorner=2pt,
innertopmargin=4pt,
innerbottommargin=4pt,
innerrightmargin=10pt,
innerleftmargin=10pt,
backgroundcolor=questioncolor}
\begin{document}
\section{Acronyms}
\begin{acronym}
\acro{UL}{University of Ljubljana}
\end{acronym}
\section{Random section}
\begin{mdframed}[style=vprasanje]
I want this acronym \acs{UL} to have different color than the one outside the mdframed environment. Perferably I want this one to have color defined above as "wantedcolor".
\end{mdframed}
I am outside of the invironment \acs{UL}!
\end{document}
答案1
在的众多选项中,\mdfdefinestyle
有settings
一个 ,它(引自手册)
允许用户在 mdframed 开始时提交一些宏。给定的材料在保存框启动之前执行。
您可以使用它在本地重新定义链接颜色。
\mdfdefinestyle{vprasanje}{%
font=\normalsize,
linecolor=questioncolor,
outerlinewidth=0pt,
roundcorner=2pt,
innertopmargin=4pt,
innerbottommargin=4pt,
innerrightmargin=10pt,
innerleftmargin=10pt,
backgroundcolor=questioncolor,
settings={\definecolor{linkcolor}{RGB}{180,190,0}}}% <-- add this line