您好,我正在尝试在 Latex 中创建一个环境来重现以下效果。
\colorbox{bg}{\ttfamily{\color[RGB]{222,222,222}
Hello
Whats up
}
}
我想说。
\begin{bashcommands}
Hello
Whats Up
\end{bashcommands}
最佳答案
这对我有用:
\makeatletter\newenvironment{bc_box}{%
\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth}}{\end{minipage}\end{lrbox}%
\colorbox{bg}{\usebox{\@tempboxa}}
}\makeatother
\newenvironment{bashcommands}{
\begin{bc_box}\ttfamily\color[RGB]{222,222,222}
}{
\end{bc_box}
}
关于latex - 在 Latex 中创建环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3251076/