我在我的文章中使用了以下包/选项:
\documentclass[b4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{color}
\newtheoremstyle{break}
{\topsep}{\topsep}%
{\itshape}{}%
{\bfseries}{}%
{\newline}{}%
\theoremstyle{break}
\newtheorem{theorem}{Theorem}%[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\begin{definition}[Test]
This is a test definition
\end{definition}
我希望名称(此处为“Test”)不仅用括号括起来,而且还要用粗体表示。我该如何实现?
谢谢你!
答案1
你的amsthm
定理样式的规范break
应如下所示:
\makeatletter
\newtheoremstyle{break}
{\topsep}{\topsep}%
{\itshape}{}%
{\bfseries}{}%
{\newline}
{\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
\thmnote{ {\bfseries(#3)}}}%
\makeatother
标头使用第九个参数进行管理。我刚刚从amsmath
来源并将注释字体替换为\bfseries
。如果将其留空,则默认为plain
定理标题样式。
这是经过上述修改的原始 MWE:
\documentclass[12pt]{article}
%\usepackage[english]{babel}
%\usepackage{amssymb}
%\usepackage{amsmath}
%\usepackage{amsfonts}
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
%\usepackage{hyperref}
%\usepackage{graphicx}
%\usepackage{color}
\makeatletter
\newtheoremstyle{break}
{\topsep}{\topsep}%
{\itshape}{}%
{\bfseries}{}%
{\newline}
{\thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
\thmnote{ {\bfseries(#3)}}}%
\makeatother
\theoremstyle{break}
\newtheorem{theorem}{Theorem}%[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
\begin{document}
\begin{definition}[Test]
This is a test definition
\end{definition}
\end{document}