以下的定义marker
来自tcolorbox.doc.s_main.sty
。对于早期版本的 Texlive(和tcolorbox
),这可以正常工作,但对于更新的 Texlive,则不行。
\documentclass{article}
\usepackage{xcolor,tikz,tcolorbox}
\usetikzlibrary{shadows}
\tcbuselibrary{skins,hooks}
\makeatletter
% from tcolorbox.doc.s_main.sty
\newtcolorbox{marker}[1][]{enhanced,
before skip=2mm,after skip=3mm,
boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
colback=yellow!50,
colframe=yellow!20!black,
sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
underlay={%
\path[fill=tcbcol@back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[draw=tcbcol@frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
},
drop fuzzy shadow,#1}
\makeatother
\begin{document}
\begin{marker}
Hylo!
\end{marker}
\end{document}
这会出现以下错误
! Package xcolor Error: Undefined color `tcbcol@back'.
See the xcolor package documentation for explanation.
Type H <return> for immediate help.
...
l.34 \end{marker}
?
为什么tcbcol@back
和tcbcol@frame
未定义,如果它们在包文档的代码中有效?或者,tcbcol@back
和的颜色的正确名称是什么?tcbcol@frame
颜色的正确名称是什么?
我的版本tcolorbox
是2019-09-19。
答案1
@
从颜色名称中删除。为什么?因为现在在tcolorbox.sty
其中一个中可以找到
colback/.colorlet=tcbcolback,
colframe/.colorlet=tcbcolframe,
等等。
\documentclass{article}
\usepackage{xcolor,tikz,tcolorbox}
\usetikzlibrary{shadows}
\tcbuselibrary{skins,hooks}
% from tcolorbox.doc.s_main.sty
\newtcolorbox{marker}[1][]{enhanced,
before skip=2mm,after skip=3mm,
boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
colback=yellow!50,
colframe=yellow!20!black,
sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
underlay={%
\path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
},
drop fuzzy shadow,#1}
\begin{document}
\begin{marker}
Hylo!
\end{marker}