In university I learned to write theorems and proofs as shown in the attached picture. Now I started typing my own lecture notes and was wondering how one could accomplish such a "frame" around the edges of the proof.
Thanks for your help.

NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
framemethod=tikz
the corners of the environment can be accessed with TikZ. Details on the package can be read in the documentation (Code: Select all
\documentclass{article}
\usepackage{amsmath,amsthm}
% upright instead of italic text in the theorem:
% \theoremstyle{definition}
% new theorem:
\newtheorem{thm}{Theorem}
% closed box instead of open box for the qed symbol:
\newcommand*\closedbox{%
\leavevmode\hbox to.77778em{\hfil\rule{.675em}{.675em}\hfil}}
\let\qedsymbol\closedbox
\usepackage[framemethod=tikz]{mdframed}
% new mdframed style that places the edges at the corners:
\mdfdefinestyle{proof}{
skipabove = .5\baselineskip ,
skipbelow = .5\baselineskip ,
leftmargin = 0pt ,
rightmargin = 0pt ,
innermargin = 0pt ,
innertopmargin = .5em ,
innerleftmargin = .5em ,
innerrightmargin = 0pt ,
innerbottommargin = 0pt ,
hidealllines = true ,
singleextra = {
\draw (O) -- ++(0,.675em) (O) -- ++(.675em,0) ;
\draw (P-|O) -- ++(0,-.675em) (P-|O) -- ++(.675em,0) ;
},
firstextra = {
\draw (P-|O) -- ++(0,-.675em) (P-|O) -- ++(.675em,0) ;
},
secondextra = {
\draw (O) -- ++(0,.675em) (O) -- ++(.675em,0) ;
},
}
% put the new mdframed style around the proof environment:
\surroundwithmdframed[style=proof]{proof}
\usepackage{lipsum}% dummy text
\begin{document}
\begin{thm}
\lipsum[2]
\end{thm}
\begin{proof}
\lipsum[2]
\end{proof}
\end{document}
I don't understand... why would it be any different with MiKTeX than any other TeX distribution? This code is independent of the TeX distribution as long it is up to date (and possibly complete).TesTT wrote:But is there an equivalent for Miktex?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p