使用 tColorBox 内联 DeclareTotalTCBox

使用 tColorBox 内联 DeclareTotalTCBox

我的目标是使用 嵌入内联代码到文本中\DeclareTotalTCBox。问题是该框不可破坏(即使我使用了该breakable选项)。我看了看手册(v 4.20)第 449 页,但我无法修复该问题。欢迎提出任何建议!谢谢。

输出

\documentclass{article}
\usepackage{showframe}
\usepackage[most, breakable]{tcolorbox}
\DeclareTotalTCBox{\inline}{v}{ 
    nobeforeafter,
    breakable,
    tcbox raise = -4pt,
    top         = 0pt,
    bottom      = 0pt,
    left        = 0pt,
    right       = 0pt,
    colback     = lightgray,
    colframe    = black,
}{\lstinline[basicstyle = \scriptsize\color{red}\tt]^#1^}

\begin{document}
Here is some random text filling the line for my problem to appear \inline{inline code inserted}
and now, the line ended.
\end{document}

相关内容