我搜索了一个 LaTeX 包,它在终端图像内显示代码,我可以在其中使用列表或铸造。
如果这不可能的话,我必须自己构建它并将其发布在这里。
答案1
这是我的解决方案:
\usepackage{fancyvrb,minted,tcolorbox}
\tcbuselibrary{skins,breakable,breakable}
\tcbuselibrary{minted}
\definecolor{terminalColor}{RGB}{38,50,56}
\definecolor{Button1}{RGB}{254,94,86}
\definecolor{Button2}{RGB}{254,188,45}
\definecolor{Button3}{RGB}{38,202,59}
\begin{tcblisting}{listing engine=minted,minted style=native,
minted language=python,enhanced,
colback=terminalColor,colframe=terminalColor,listing only, title=\tikz {
\node[circle,fill=Button1,inner sep=3pt] (c) at (0,0){};
\node[circle,fill=Button2,inner sep=3pt] (c) at (0.5,0){};
\node[circle,fill=Button3,inner sep=3pt] (c) at (1,0){};
} ~~~~~~Terminal}
>>> a = [1, 2, 3]
>>> b = a
>>> b.append(4)
>>> b
[1, 2, 3, 4]
\end{tcblisting}