我的分数怎么了???
\documentclass[a4paper,12pt]{report}
\usepackage[many]{tcolorbox}
\tcbset{enhanced,boxrule=0.8pt,bottomrule=1.6pt,arc=0pt,auto outer arc,lifted shadow={1mm}{-1mm}{2mm}{0.1mm}{gray!60}}
\begin{document}
\begin{center}
\begin{tcolorbox}[colback=red!20,colframe=red!40,hbox]
\[ I = \frac{dQ}{dt} \]
\end{tcolorbox}
\end{center}
\end{document}
many
(此外,我放入还是most
导入有关系吗tcolorbox
?有什么区别?)
答案1
我想知道您是否正在寻找类似的东西。
\documentclass[a4paper,12pt]{report}
\usepackage[many]{tcolorbox}
\usepackage{empheq}
\tcbset{enhanced,boxrule=0.8pt,bottomrule=1.6pt,arc=0pt,auto outer arc,lifted shadow={1mm}{-1mm}{2mm}{0.1mm}{gray!60}}
\begin{document}
\tcbset{highlight math style={colback=red!20,colframe=red!40}}
\begin{empheq}[box=\tcbhighmath]{equation*}
I = \frac{\mathrm{d}Q}{\mathrm{d}t}
\end{empheq}
\end{document}
您还可以定义一个以颜色作为可选参数的框。
\documentclass[a4paper,12pt]{report}
\usepackage[many]{tcolorbox}
\usepackage{empheq}
\tcbset{enhanced,boxrule=0.8pt,bottomrule=1.6pt,arc=0pt,auto outer arc,lifted shadow={1mm}{-1mm}{2mm}{0.1mm}{gray!60}}
\newtcbox{\Mattbox}[1][red]{nobeforeafter,math upper,
colback=#1!20,colframe=#1!40}
\begin{document}
\begin{empheq}[box={\Mattbox}]{equation*}
I = \frac{\mathrm{d}Q}{\mathrm{d}t}
\end{empheq}
\begin{empheq}[box={\Mattbox[blue]}]{equation*}
I = \frac{\mathrm{d}Q}{\mathrm{d}t}
\end{empheq}
\end{document}