我尝试theorem
在工作中利用环境作为示例问题。
这是我的 MWE:
\documentclass{book}
\usepackage{amsthm}
\newtheoremstyle{mythmstyle}
{}{}{}{}
{\bf}
{}
{\newline}
{}
\theoremstyle{mythmstyle}
\newtheorem{mythm}{Sample Problem}[chapter]
\setcounter{chapter}{2}
\begin{document}
\chapter{New Chapter}
\begin{mythm}
Problem statement goes here. But, where does go title?
\end{mythm}
\end{document}
输出如下:
事实上我需要这样的东西,
换句话说,我的示例问题缺乏标题。
如何在定理环境中包含标题?
答案1
这是一个带有 的解决方案thmtools
,它可以轻松定义新的定理样式:
\documentclass{book}
\usepackage[utf8]{inputenc} \usepackage{fourier, erewhon, cabin}
\usepackage[table, x11names]{xcolor} \usepackage{mathtools}
\usepackage{amsthm, thmtools}
\usepackage{microtype} \SetTracking[no ligatures = {f}]{encoding = *}{50}
\declaretheoremstyle[%
headfont=\color{SteelBlue3}\sffamily\bfseries\lsstyle,
within=chapter, headpunct={\medskip}, postheadspace=\newline, notefont=\color{black}\mdseries, notebraces = {\quad}{},spaceabove = 8pt,spacebelow = 8pt]%
{sample}
\declaretheorem[name=Sample Problem, style=sample]{mypb}
\begin{document}
\setcounter{chapter}{3}
\begin{mypb}[Adding vectors in a drawing, orienteering]
Show the following assertion is true: %
\begin{equation*}
a = a
\end{equation*}
\end{mypb}
\end{document}