缩进定理和证明环境

缩进定理和证明环境

我希望能够重新创建以下定理样式,其中定理/证明/定义等的主体以可变的量缩进。我还想用实心圆而不是正方形来结束定理证明。标签“定义 1.1.,等等”应与定义文本的第一行垂直对齐。我该如何实现这一点?

作为起点,我正在处理以下文档。

\documentclass[11pt,a4paper]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage{xcolor}
\usepackage[calcwidth]{titlesec}
\usepackage{blindtext}
\usepackage{scrextend}
\usepackage{microtype}
\usepackage[leqno]{amsmath}
\usepackage[standard,amsmath,thmmarks]{ntheorem} 
\usepackage{etoolbox}
\makeatletter
\setlength \labelsep {3.15em} 
\newtheoremstyle{mymargin}%
{\item[\theorem@headerfont \llap{##1 ##2}]}%
{\item[\theorem@headerfont \llap{##1 ##2}| ##3\theorem@separator\hskip\labelsep]}%
\makeatother


% my definition
\theoremstyle{mymargin}
\theorembodyfont{}   
\theoremsymbol{}
\theoremprework{}
\theorempostwork{}
\theoremseparator{.}
\newtheorem{mydefinition}{Definition}
\numberwithin{mydefinition}{section}
\newtheorem{mythm}{Theorem}
\numberwithin{mythm}{section}

\begin{document}

\section{A test section}
\begin{addmargin}[10em]{0em}\begin{mydefinition}\blindtext\end{mydefinition}
\end{addmargin}

\end{document}

在此处输入图片描述

答案1

我不喜欢ntheorem。这是修改版https://tex.stackexchange.com/a/106582/4427

\documentclass[a4paper]{article}
\usepackage{amsthm,thmtools}
\usepackage{etoolbox}

\usepackage{lipsum} % just for context
\usepackage{showframe} % for showing the margins

\makeatletter
\newlength{\thmindent}
\AtBeginDocument{\setlength{\thmindent}{15em}}
\patchcmd\@thm
  {\trivlist}
  {\list{}{\leftmargin\thmindent}}
  {}{}
\newcommand{\xdeclaretheorem}[2][]{%
  \declaretheorem[#1]{#2}%
  \expandafter\patchcmd\csname thmt@original@end#2\endcsname
    {\endtrivlist}{\endlist}{}{}%
}

\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont 
  \list{}{\leftmargin=\thmindent}
  \item
  \makebox[0pt][r]{\makebox[\thmindent][l]{\itshape#1\@addpunct{.}}}\ignorespaces
}{%
  \popQED\endlist\@endpefalse
}
\renewcommand{\qedsymbol}{\textbullet}
\makeatother


\declaretheoremstyle[
  headpunct={},
  headfont=\bfseries,
  bodyfont=\normalfont,
  headindent=0pt,
  postheadspace=0pt,
  headformat={\makebox[0pt][r]{\makebox[\thmindent][l]{\NAME\ \NUMBER.}}},
]{INDENTthm}

\xdeclaretheorem[
  within=section,
  style=INDENTthm,
  name=Theorem
]{thm}

\xdeclaretheorem[
  sibling=thm,
  style=INDENTthm,
  name=Lemma
]{lem}

\begin{document}

\begin{thm}
\lipsum*[2]
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{thm}

\begin{lem}
\lipsum*[2]
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{lem}

\begin{proof}
\lipsum*[2]
\end{proof}

\end{document}

在此处输入图片描述

相关内容