0

I was wondering if there is any package or a simple snippet I could use to get the kind of corners shown in the picture for theorems and definitions.

Thanks in advance.

Source: MIT Mathematics of Machine Learning course.

  • Yes, such packages exist and they are called tcolorbox and tcolorbox. Just do a google image search for site:tex.stackexchange.com tcolorbox theorem and click on whatever looks promising. This will give you an idea and also a starting point for a question which is more appreciated. –  Jun 22 '19 at 01:38
  • @marmot I found some packages like that one but they provide full boxes. I didn't see any example showing isolated corners. Maybe it's possible to do it with the tcolorbox tools, but I have no idea how. – almostsurely Jun 22 '19 at 01:43

1 Answers1

1

This is to give you a start. All I did was to look up an answer, I randomly chose this one and cooked it down to

\documentclass{book}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage[most]{tcolorbox}

\newtcbtheorem[number within=chapter]{Theorem}{}{
        enhanced,sharp corners,colback=white,colframe=white,top=-0.5em,
        overlay={%
        \draw[gray!40,line width=3pt] ([yshift=-1cm]frame.north west) 
        |- ++ (1,1) ([yshift=1cm]frame.south east) |- ++ (-1,-1);
        },
    }{thm}

\newenvironment{myTheorem}[1]{\begin{Theorem}{}{#1}\textbf{Theorem:}}{\end{Theorem}}

\begin{document}
\chapter{Foo}
\begin{myTheorem}{thm:FermatsLastTheorem}
    No three positive integers \(a\), \(b\) and \(c\) satisfy the equation \(a^{n} + b^{n} = c^{n}\) for any integer greater than two.
\end{myTheorem}
\end{document}

enter image description here

The fact that the answer I link to achieves so much more than this one may give you an idea of what it possible. Note that the answer I link to answers a question in which the user provided an MWE, such questions tend to get received better.