一旦 latex 代码太长,第二帧就无法正确显示。
如何切割 tcblisting 的框,以便一方面列出列表,另一方面执行列表,位于两个单独的框架中
\documentclass{article}
\usepackage{tikzducks}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcblisting}{title={Birthday duck}}
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
\begin{tikzpicture}
\duck[cake]
\end{tikzpicture}
\end{tcblisting}
\end{document}
答案1
您可以添加以下breakable
选项:
\documentclass{article}
\usepackage{tikzducks}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcblisting}{title={Birthday duck},breakable}
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
very long text latex
\begin{tikzpicture}
\duck[cake]
\end{tikzpicture}
\end{tcblisting}
\end{document}