I wanted to try an answer with \tcolorbox
just as an exercise, but Bernard gave a good reason, thmbox
can't break across pages and tcbtheorems
can. So, in case someone is interested, here you have a starting point.
A tcbthmbox
looks similar to thmbox
, tcbSthmbox
like [S]-thmbox
and tcbLthmbox
like [L]-thmbox
.
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath,amssymb}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\tcbset{
thmbox/.style={
enhanced,
breakable,
sharp corners=all,
fonttitle=\bfseries\normalsize,
fontupper=\normalsize\itshape,
top=0mm,
bottom=0mm,
right=0mm,
colback=white,
colframe=white,
colbacktitle=white,
coltitle=black,
attach boxed title to top left,
boxed title style={empty, size=minimal, bottom=1.5mm},
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)|-%
(frame.south east)--(frame.north east);},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);
\draw (frame.north east)--(frame.south east);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);
\draw (frame.north east)--(frame.south east);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)|-%
(frame.south east)--(frame.north east);},
},
S/.style={thmbox,
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
},
L/.style={thmbox,
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);},
},
LQ/.style={thmbox,
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);
\node[anchor=east] at (frame.south east) {$\square$};},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)|-([xshift=15mm]frame.south west);
\node[anchor=east] at (frame.south east) {$\square$};},
},
}
\newtcbtheorem[]{tcbthmbox}{Theorem}{thmbox}{theo}
\newtcbtheorem[]{tcbSthmbox}{Theorem}{thmbox,S}{theo}
\newtcbtheorem[]{tcbLthmbox}{Theorem}{thmbox,L}{theo}
\newtcbtheorem[]{proof}{Démonstration}{thmbox,LQ}{theo}
\begin{document}
\begin{tcbthmbox}{First result}{}
\lipsum[3]
\end{tcbthmbox}
\begin{tcbSthmbox}{Important}{}
\lipsum[2]
\end{tcbSthmbox}
\begin{tcbLthmbox}{Final}{}
\lipsum[1]
\end{tcbLthmbox}
\begin{proof}{Proof}{}
\lipsum[1]
\end{proof}
\end{document}
Update:
\newtcbtheorem[<init options>]{<name>}{<display name>}{<options>}{<prefix>}
has five parameters <init options>
are related with automatic numbering; name
is the name used as environment \begin{name}...\end{name}
; display name
, the word or words used before title: Theorem, Lemma, Démonstration, ...; options
are all tcolorbox
options to define its appearance and prefix
a prefix used before the label assigned to each environment. Once defined, every tcbtheorem
environment is declared with
\begin{name}{title}{label}
...
\end{name}
which uses two mandatory arguments, title
and label
. They are mandatory but can be empty. If a proof doesn't have any title except Démonstration
, just leave the title empty. In this case :
(or any other character used between display name
and title
) will vanish.
If you also want to suppress theorem numbers, you have two options, the first one is \begin{name*}...\end{name*}
. The starred variant doesn't have number but it's also unlabeled and not listed in list of theorems. A second possibility consists in using option theorem name
is theorem options. This options can be added inside \tcbset
command, in \newtcbtheorem
<options>
parameter or through an optional argument in theorem environment: \begin{proof}[theorem name]{}{}
.
Following code which has been a little bit simplified from previous version, shows some examples with proof
:
\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath,amssymb}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\tcbset{
thmbox/.style={
enhanced,
breakable,
sharp corners=all,
fonttitle=\bfseries\normalsize,
fontupper=\normalsize\itshape,
top=0mm,
bottom=0mm,
right=0mm,
colback=white,
colframe=white,
colbacktitle=white,
coltitle=black,
attach boxed title to top left,
boxed title style={empty, size=minimal, bottom=1.5mm},
overlay unbroken ={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay first={
\draw (title.south west)--(title.south east);
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay middle={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
overlay last={
\draw ([xshift=3.5mm]frame.north west)--([xshift=3.5mm]frame.south west);},
},
Boxed/.style={
overlay unbroken and last app ={
\draw ([xshift=3.5mm]frame.south west)-|(frame.north east);},
},
L/.style={
overlay unbroken and last app ={
\draw ([xshift=3.5mm]frame.south west)--++(0:11.5mm);},
},
Q/.style={
overlay unbroken and last app={
\node[anchor=east] at (frame.south east) {$\square$};},
},
}
\newtcbtheorem[]{tcbthmbox}{Theorem}{thmbox,Boxed}{theo}
\newtcbtheorem[]{tcbSthmbox}{Theorem}{thmbox}{theo}
\newtcbtheorem[]{tcbLthmbox}{Theorem}{thmbox,L}{theo}
\newtcbtheorem[]{proof}{Démonstration}{thmbox,Q}{theo}
\begin{document}
\begin{proof}{Title}{}
\textcolor{red}{A demonstration with title and number}
\lipsum[2]
\end{proof}
\begin{proof}{}{}
\textcolor{red}{A demonstration without title but with number}
\lipsum[3]
\end{proof}
\begin{proof}[theorem name]{}{}
\textcolor{red}{A demonstration without title and number}
\lipsum[3]
\end{proof}
\begin{proof*}{}
\textcolor{red}{Starred version}
\lipsum[3]
\end{proof*}
\end{document}
\documentclass{...}
and ending with\end{document}
.