документация tcolorbox: предотвращение пробелов между головой и телом

документация tcolorbox: предотвращение пробелов между головой и телом

Я использую tcolorboxдля документирования некоторых команд, и я хотел бы иметь небольшой фоновый цвет для основного текста объяснений команд. У меня есть нижеприведенный MWE, чтобы показать это, обернув тело в его собственный tcolorbox со значением colback.

Однако я хотел бы удалить белое пространство между головой и телом, чтобы они были напрямую соединены. Я пробовал настраивать поля через nobeforeafterи 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}

выход

Связанный контент