
いくつかのコマンドを文書化するために使用していますtcolorbox
が、コマンドの説明の本文にわずかに背景色を付けたいと思っています。以下の MWE を使用して、値を持つ独自の tcolorbox で本文をラップすることでこれを示していますcolback
。
しかし、私は頭と体の間の空白を削除して、それらが直接接続されるようにしたいと考えています。ボックスを vianobeforeafter
およびbefore/after skip
s で調整しようとしましたが、うまくいきませんでした。
本体 (つまり、プリアンブルのキーを使用して作成した tcolorbox before/after doc body
) が何かにラップされていると思われますが、それにアクセスして変更する方法がわかりません。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{documentation}
\tcbset{
doc head={
interior style={fill,color=blue!10},
boxsep=2pt,
after skip=0pt,
nobeforeafter,
%show bounding box,
},
before doc body={
\begin{tcolorbox}[
colback=blue!5,
colframe=blue!5,
arc=0pt,
outer arc=0pt,
before skip=0pt,
nobeforeafter,
]
},
after doc body={\end{tcolorbox}},
}
\begin{document}
\begin{docCommand}
{myCommand}
{\marg{argument}}
Some description of the command. Blah blah blah.
\end{docCommand}
\end{document}
答え1
ドキュメント ヘッドtcolorbox
は 内に配置されtcbraster
、そのデフォルトの after skip は 4.1pt です。これを を使用して 0pt に設定しdoc raster={raster after skip=0pt}
、ギャップを削除します。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{documentation}
\tcbset{
doc head={
interior style={fill,color=blue!10},
boxsep=2pt,
},
doc raster={raster after skip=0pt},
before doc body={
\begin{tcolorbox}[
colback=blue!5,
colframe=blue!5,
arc=0pt,
outer arc=0pt,
before skip=0pt,
]
},
after doc body={\end{tcolorbox}},
}
\begin{document}
\begin{docCommand}
{myCommand}
{\marg{argument}}
Some description of the command. Blah blah blah.
\end{docCommand}
\end{document}