tcolorbox 停用空白選項

tcolorbox 停用空白選項

在編寫一個包時,我開始使用tcolorbox它及其documentation庫。我找到了鑰匙doc head command等並開始定制。但這有很大的限制,因為我基本上無法使用這些enhanced功能。原因(來自包中的代碼):

\newtcolorbox{tcb@doc@head}[1]{blank,colback=white,colframe=white,
  code={\tcbdimto\tcb@temp@grow@left{-\kvtcb@doc@indentleft}%
        \tcbdimto\tcb@temp@grow@right{-\kvtcb@doc@indentright}},
  grow to left by=\tcb@temp@grow@left,%
  grow to right by=\tcb@temp@grow@right,
  sidebyside,sidebyside align=top,
  sidebyside gap=-\tcb@w@upper@real,
  phantom=\phantomsection,%
  enlarge bottom by=-0.2\baselineskip,#1}

blank它包含禁用所有繪圖的選項。出於定制目的,我想將其刪除。我真的必須重新定義整個命令還是有簡單的方法?

微量元素:

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{documentation}
\tcbset{
doc head command={colback=black} % disable blank here for the fancy stuff
}

\begin{document}
\begin{docCommand}{examplecommand}
Test
\end{docCommand}
\end{document}

答案1

\tcbset{blank/.style={}}最簡單的方法是在加載庫後說documentation,但這可能會破壞其他環境(如果在那裡使用,tcolorbox它們的外觀會改變)。blank

另一個解決方案是定義noblank部分撤銷其中的定義blank(請參閱文件tcbskins.code.tex中的設定),不幸的是,某些選項必須手動複製和變更。

\documentclass{article}
\usepackage{tcolorbox}


\tcbuselibrary{documentation}


% From tcbskins.code.tex
% blank/.style={enhanced,frame hidden,interior hidden,segmentation hidden,%
%    arc=0pt,outer arc=0pt,boxsep=0pt,top=0pt,bottom=0pt,left=0pt,right=0pt,boxrule=0pt,%
%    bottomtitle=6pt,middle=3pt}}

\tcbset{
  noblank/.style={enhanced,frame style={draw,fill=tcbcol@frame}, interior style={draw,fill=tcbcol@back}, segmentation hidden,sharp corners,
    %boxrule=1pt, % Change at will
    %boxsep=1pt,
  }
}

\tcbset{
  doc head command={colback=black,noblank} % disable blank here for the fancy stuff
}




\begin{document}
\begin{docCommand}{examplecommand}{}
Test
\end{docCommand}
\end{document}

在此輸入影像描述

相關內容