
答案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}