我正在尝试使用下面的代码设计一个定理样式。但是,我希望能够在短语后面写出定理的名称。我的意思是我希望有
定理 1(第一定理)
啦啦啦
在框架顶部的栏上。您有什么想法吗?谢谢!
\documentclass{article}
\usepackage{lipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}
\mdtheorem[roundcorner=5pt,backgroundcolor=gray!10,
shadow=true,frametitlerule=true,
middlelinewidth=1pt,frametitlerulewidth=1pt,
innertopmargin=\topskip,
apptotikzsetting={\tikzset{mdfbackground/.append style={left color=gray!10!white,right color=white},
mdfframetitlebackground/.append style ={left color=white,right color=gray!10!white}}}]{Theorem}{Theorem}
\begin{document}
\begin{Theorem}
If $a^m=a^n$ then $m=n$ or $a=1$ or $a=-1$ and $m$, $n$ are even integers.
\end{Theorem}
\end{document}
答案1
% arara: pdflatex
\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}
\mdtheorem[roundcorner=5pt,backgroundcolor=gray!10,
shadow=true,frametitlerule=true,
middlelinewidth=1pt,frametitlerulewidth=1pt,
innertopmargin=\topskip,
apptotikzsetting={\tikzset{mdfbackground/.append style={left color=gray!10!white,right color=white},
mdfframetitlebackground/.append style ={left color=white,right color=gray!10!white}}}]{Theorem}{Theorem}
\begin{document}
\begin{Theorem}[(First Theorem)]
If $a^m=a^n$ then $m=n$ or $a=1$ or $a=-1$ and $m$, $n$ are even integers.
\end{Theorem}
\end{document}