我正在使用包ntheorem
并framed
创建类似的盒子1。有人知道如何将标题更改为以下顺序吗:
名称.计数器:参数
例如:尔格。 2:创建层次结构规则。響。音素
我的实际设置是:
\usepackage{framed}
\usepackage[hyperref, amsmath, amsthm, framed, thmmarks]{ntheorem}
\theoremstyle{break}
\theoremheaderfont{\normalfont\smallskip\scriptsize\bfseries}
\theorembodyfont{\normalfont\scriptsize}
\theoremindent0.5cm
\newframedtheorem{erg}{Erg.}
答案1
括号实际上是在样式定义中硬编码的break
,因此需要更改定义。
\documentclass{article}
\usepackage{amsmath}
\usepackage{framed}
\usepackage[hyperref, amsmath, amsthm, framed, thmmarks]{ntheorem}
\makeatletter
\renewtheoremstyle{break}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
##1\ ##2\theorem@separator}\hbox{\strut}}}]}%
{\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
% ##1\ ##2\ (##3)\theorem@separator}\hbox{\strut}}}]}% DELETED
##1\ ##2:\ ##3\theorem@separator}\hbox{\strut}}}]}% NEW
\makeatother
\theoremstyle{break}
\theoremheaderfont{\normalfont\smallskip\scriptsize\bfseries}
\theorembodyfont{\normalfont\scriptsize}
\theoremindent0.5cm
\newframedtheorem{erg}{Erg.}
\begin{document}
\begin{erg}[Description]
Some text.
\end{erg}
\end{document}