自己的证明环境:如何自动添加qed符号?

自己的证明环境:如何自动添加qed符号?

我如何调整证明环境的定义以便它自动在证明环境末尾添加一个填充的黑框?

\RequirePackage{fix-cm}

\documentclass[a4paper,fontsize=12pt,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[inline]{enumitem}


\setlength{\parindent}{0ex}
\setlength{\parskip}{1ex}
\setlength{\jot}{12pt}

\usepackage[onehalfspacing]{setspace}



\newtheoremstyle{my_proof_style}
  {20pt}{20pt}%
  {\upshape}{}%
  {\itshape}{.}%
  {.5em}{}%

\theoremstyle{my_proof_style}
\newtheorem*{my_proof}{Proof}



\newtheoremstyle{my_theorem_style}
  {20pt}{20pt}%
  {\itshape}{}%
  {\bfseries}{.}%
  {\newline}{}%

\theoremstyle{my_theorem_style}
\newtheorem{theorem}{Theorem}[section]



\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum.

\begin{theorem}
Aliquam ultrices sagittis orci a scelerisque purus semper eget. Eget sit amet tellus cras adipiscing enim eu turpis egestas:
\end{theorem}


\begin{my_proof}
%
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum. 

Amet nulla facilisi morbi tempus iaculis urna id volutpat. Adipiscing elit duis tristique sollicitudin nibh sit. Aliquam ultrices sagittis orci a scelerisque purus semper eget. 
%
\end{my_proof}

\end{document}

在此处输入图片描述

答案1

proof修改您想要的(太)大间距的标准环境更为简单。

\RequirePackage{fix-cm}

\documentclass[a4paper,fontsize=12pt,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[inline]{enumitem}


\setlength{\parindent}{0ex}
\setlength{\parskip}{1ex}
\setlength{\jot}{12pt}

\usepackage[onehalfspacing]{setspace}

\newtheoremstyle{my_theorem_style}
  {20pt}{20pt}%
  {\itshape}{}%
  {\bfseries}{.}%
  {\newline}{}%

\theoremstyle{my_theorem_style}
\newtheorem{theorem}{Theorem}[section]

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep20\p@\@plus4\p@\relax % <--- changed here
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{.}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother
\renewcommand{\qedsymbol}{\ensuremath{\blacksquare}}


\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec
sagittis aliquam malesuada bibendum.

\begin{theorem}
Aliquam ultrices sagittis orci a scelerisque purus semper eget. Eget sit 
amet tellus cras adipiscing enim eu turpis egestas:
\end{theorem}


\begin{proof}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate 
sapien nec sagittis aliquam malesuada bibendum. 

Amet nulla facilisi morbi tempus iaculis urna id volutpat. Adipiscing 
elit duis tristique sollicitudin nibh sit. Aliquam ultrices sagittis 
orci a scelerisque purus semper eget. 
\end{proof}

\end{document}

在此处输入图片描述

如果要保留my_proof,只需添加

\newenvironment{my_proof}{\proof}{\endproof}

不相关,但如果您确实想使用\parskip,请使用scrartcl特定选项。

答案2

amsthm默认情况下具有Proof定义,如果您想将其更改\qed为实心黑框,则尝试单独更改它,例如:

\usepackage{amsthm}
\renewcommand{\qedsymbol}{\rule{4pt}{4pt}}

\begin{document}
\begin{proof}
...
...
\end{proof}

相关内容