我的分數怎麼了?
\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}