答案1
您可以简单地将其放在里面\fbox{...}
:
\documentclass[border=5pt]{standalone}
\usepackage{xcolor}
\newcommand{\pyobject}[1]{\fbox{\color{red}{\texttt{#1}}}}
\begin{document}
CVXOPT extends the built-in Python objects with two matrix objects: a \pyobject{matrix} object for dense
\end{document}
或者,如果你想要圆角,请\ovalbox{...}
使用fancybox
包裹:
\documentclass[border=5pt]{standalone}
\usepackage{xcolor,fancybox}
\newcommand{\pyobject}[1]{\ovalbox{\color{red}{\texttt{#1}}}}
\begin{document}
CVXOPT extends the built-in Python objects with two matrix objects: a \pyobject{matrix} object for dense
\end{document}