我刚刚看到这个解决方案证明环境很好,我非常喜欢。
我想知道是否有一种优雅的方法可以在定理环境下做到这一点。
笔记 我不想使用盒子或者 mdframed 包......
编辑:例如以下代码不起作用:
\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{thmtools}
\usepackage[thmmarks, thref, amsmath]{ntheorem}
\theoremstyle{plain}
\theoremprework{\bigskip\hrule\vspace{-1.5ex}\leavevmode\nobreak}%\leavevmode
\theorempostwork{\vspace*{-1ex}\hrule\bigskip\leavevmode}
\theoremheaderfont{\scshape}
\theorembodyfont{\itshape}
\theoremseparator{. }
\newtheorem{thm}{Theorem}
\begin{document}
\tableofcontents
\lipsum[1]
\begin{thm}[D’Alembert-Gauss]
The field $\mathbf C$ is algebraically closed.
\end{thm}
\lipsum[2]
\addcontentsline{toc}{chapter}{List of Theorems}
\listoftheorems[ignoreall,onlynamed={thm,lmm,prop}
\end{document}
答案1
使用 \theoremprework
和\theorempostwork
命令非常简单ntheorem
:
\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage[thmmarks, thref, amsmath]{ntheorem}%
\theoremstyle{plain}
\theoremprework{\bigskip\hrule\vspace{-1.5ex}\leavevmode\nobreak}%\leavevmode
\theorempostwork{\vspace*{-1ex}\hrule\bigskip\leavevmode}
\theoremheaderfont{\scshape}
\theorembodyfont{\itshape}
\theoremseparator{. }
\newtheorem{thm}{Theorem}
\usepackage{thmtools}
\begin{document}
\tableofcontents
\bigskip
\lipsum[1]
\begin{thm}[D’Alembert-Gauss]
The field $\mathbf C$ is algebraically closed.
\end{thm}
\lipsum[2]
\bigskip
\addcontentsline{toc}{chapter}{List of Theorems}
\theoremlisttype{allname}
\listtheorems{thm}%
\end{document}