答案1
根据您链接的答案,定义
\newtheoremstyle{defbrakets}% Name
{}% space above
{}% space below
{\normalfont}% body font
{}% indent
{\bfseries}% head font
{.}% punctuation after head
{ }% space after head (has to be space or dimension!)
{\thmheadbrackets{#1}{#2}{#3}}% head spec
然后使用
\theoremstyle{defbrakets}
例子:
\documentclass{article}
\usepackage{amsthm}
\makeatletter
\def\thmheadbrackets#1#2#3{%
\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
\thmnote{ {\the\thm@notefont[#3]}}}
\makeatother
\newtheoremstyle{brakets}% Name
{}% space above
{}% space below
{\itshape}% body font
{}% indent
{\bfseries}% head font
{.}% punctuation after head
{ }% space after head (has to be space or dimension!)
{\thmheadbrackets{#1}{#2}{#3}}% head spec
\newtheoremstyle{defbrakets}% Name
{}% space above
{}% space below
{\normalfont}% body font
{}% indent
{\bfseries}% head font
{.}% punctuation after head
{ }% space after head (has to be space or dimension!)
{\thmheadbrackets{#1}{#2}{#3}}% head spec
\theoremstyle{brakets}
\newtheorem{thm}{Theorem}
\theoremstyle{defbrakets}
\newtheorem{dfn}[thm]{Definition}
\begin{document}
\begin{thm}[title]
theorem's body
\end{thm}
\begin{dfn}[title]
definition's body
\end{dfn}
\end{document}