tcolorbox ドキュメント: 頭と体の間に隙間ができないようにする

tcolorbox ドキュメント: 頭と体の間に隙間ができないようにする

いくつかのコマンドを文書化するために使用していますtcolorboxが、コマンドの説明の本文にわずかに背景色を付けたいと思っています。以下の MWE を使用して、値を持つ独自の tcolorbox で本文をラップすることでこれを示していますcolback

しかし、私は頭と体の間の空白を削除して、それらが直接接続されるようにしたいと考えています。ボックスを vianobeforeafterおよびbefore/after skips で調整しようとしましたが、うまくいきませんでした。

本体 (つまり、プリアンブルのキーを使用して作成した 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}

出力

関連情報