2

How can I adjust the definition of the proof environment such that it automatically adds a filled black box at the end of a proof environment?

\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}

enter image description here

2 Answers 2

2

It's simpler to modify the standard proof environment with the (too) large spacing you seem to want.

\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}

enter image description here

If you want to keep my_proof, just add

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

Unrelated, but if you really want to use \parskip, employ the scrartcl specific option.

2
  • Thank you very much!! To be honest, when it comes to vertical spacing, I am overwhelmed by the oprions and probably dont know what I am doing...I just want a setting which makes a maths paper easy to read...If you have any recommendation I am very very thankful... Commented Oct 28, 2021 at 17:52
  • 1
    @u49K3df2 Reduce the spacing. Don't use \parskip, nor \onehalfspacing. But it's just my personal opinion (well, not only mine) that space in excess between lines hinders readability, rather than make it easier.
    – egreg
    Commented Oct 28, 2021 at 17:52
1

amsthm having Proof defintions by default, if you want to change the \qed into a solid black box, then try to alter that alone, e.g.:

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .