我已经使用包\DeclareTotalTCBox
中的命令定义了一个命令tcolorbox
,如下所示:
\documentclass{article}
\usepackage[most]{tcolorbox}
\DeclareTotalTCBox{\myverb}{ O{red} v O{} }
{ fontupper=\ttfamily, nobeforeafter,tcbox raise base,arc=0pt,outer arc=0pt,
top=0pt,bottom=0pt,left=0mm,right=0mm,
leftrule=0pt,rightrule=0pt,toprule=0.3mm,bottomrule=0.3mm,boxsep=0.5mm,
colback=#1!10!white,colframe=#1!50!black,#3}{#2}
\newcommand{\code}[1]{\hbox{\myverb{#1}}}
\begin{document}
Work \myverb{\LaTeX} Work
Not Working \code{\LaTeX} Not working
\end{document}
\myverb
单独使用有效,但定义的命令\code
不起作用!!! 有错误吗?