嗨,我正在尝试在 Latex 中创建一个环境,以重现以下效果。
\colorbox{bg}{\ttfamily{\color[RGB]{222,222,222}
Hello
Whats up
}
}
我想能够说。
\begin{bashcommands}
Hello
Whats Up
\end{bashcommands}
嗨,我正在尝试在 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}
}
使用Donald Arseneau 的 framed.sty,您可以做到这一点,如果您需要跨越多个页面,它也可以很好地工作。
\新环境{bash命令}{% \definecolor{shadecolor}{命名}{bg}% \begin{阴影}\ttfamily\color[RGB]{222,222,222}% }{% \end{阴影}% }