我想删除 mdframed 中定义的这个定理中的编号
\documentclass{article}
\usepackage{amssymb}
\usepackage[framemethod=TikZ]{mdframed}
\newcounter{theo}%[section] \setcounter{theo}{0}
\newenvironment{theo}[2][]{%
\refstepcounter{theo}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem~\thePrte};}}
}%
{\mdfsetup{%
frametitle={
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem~\thetheo:~#1};}}%
}%
\mdfsetup{innertopmargin=5pt, innerbottommargin=10pt, linecolor=yellow!60!brown!60!,%
linewidth=2.3pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax, roundcorner=5pt
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}
\begin{document}
\begin{theo}[{\tiny Théorème des valeurs intermédiaires}]{}
Soit $f$ une fonction definie sur $\mathbb{R}$...
\end{theo}
\end{document}
答案1
请确保您发布的代码可以编译,除非您请求有关编译错误的帮助。
\the<counter name>
生成 LaTeX 计数器当前值的排版版本<counter>
。因此,删除这些会从输出中删除数字。
\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amssymb}
\newenvironment{theo}[2][]{%
\ifstrempty{#1}%
{%
\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
{\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem};}%
},
}
}%
{%
\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
{\node[anchor=east,rectangle,fill=yellow!60!brown!60!]
{\strut Theorem:~#1};}%
},
}%
}%
\mdfsetup{%
innertopmargin=5pt, innerbottommargin=10pt, linecolor=yellow!60!brown!60!, linewidth=2.3pt,topline=true, frametitleaboveskip=\dimexpr-\ht\strutbox\relax, roundcorner=5pt,
}%
\begin{mdframed}[]\relax
\label{#2}%
}{%
\end{mdframed}%
}
\begin{document}
\begin{theo}[{\tiny Théorème des valeurs intermédiaires}]{}
Soit $f$ une fonction definie sur $\mathbb{R}$...
\end{theo}
\end{document}