目前我使用橙色作为默认颜色。但我想使用语法定义的默认颜色
{rgb}{0.98,41.0,0.08}
如何调整此代码以便默认值{rgb}{0.98,41.0,0.08}
同时仍然能够调用\wvPz[red]
和\wvPz[rgb][0.98,41.0,0.08]
。
\documentclass[a4paper,12pt]{book}
\usepackage{xcolor}
\begin{document}
\ExplSyntaxOn
\NewDocumentEnvironment{wvPz}{O{orange}ommo}
{
\medskip
\noindent #3 \ #4
\IfNoValueTF {#5}
{ \hspace{0.5cm} }
{ \ (#5) \par\smallskip }
\IfNoValueTF{#2}
{ \color{#1} }
{ \color[#1]{#2} }
}
{
\par\medskip
}
\ExplSyntaxOff
\begin{document}
\begin{wvPz}{Something}{2.2.1}[Name]
C is a field. R is a subfield of C.
\end{wvPz}
\begin{wvPz}[rgb][0.98,41.0,0.08]{Something}{2.2.1}[Name]
C is a field. R is a subfield of C.
\end{wvPz}
\end{document}