如何将定义标题放在方括号中(而不是括号中)

如何将定义标题放在方括号中(而不是括号中)

这个问题是关于将定理标题放在方括号中:

如何将定理标题放在方括号中(而不是括号中)

我怎样才能对定义做同样的事情?

答案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} 

在此处输入图片描述

相关内容