2

I'm trying to reproduce the picture below: I want an environment with 1 parameter for the title (on the picture: "Définition 35" or "Définition 36") which is always bold and underlined, and the content of the environment (text, maths, or whatever) is displayed in a sort of lfloor sign below. Also, the horizontal part of the lfloor-like sign on the left never changes its length, only the vertical left bar adjusts its height to the height of the text (see picture below).

I wasn't able to find something anywhere (probably because of my broken english -- and I hope I'm even understandable ! ...), and I really hope someone will be able to help me !

Thanks !

lfloor environment to reproduce

2 Answers 2

3

Welcome to TeX.SX!

This is an approach with tikz and environ packages.

\documentclass{article}
\usepackage{tikz}
\usepackage{environ}
\usetikzlibrary{calc}
\usepackage{parskip}
\usepackage{lipsum}

\newcounter{Defin}
\newsavebox{\DefTitleBox}
\newsavebox{\DefBox}
\NewEnviron{myDefi}{\refstepcounter{Defin}\savebox{\DefTitleBox}{\hbox{{\bfseries Definition \theDefin:\space}}}\savebox{\DefBox}{\parbox[t]{0.9\textwidth}{\BODY}}%
\noindent\begin{tikzpicture}
\draw[ultra thick] (0,0)--(1.1\wd\DefTitleBox,0)node[midway, above]{\usebox\DefTitleBox};
\draw[ultra thick](3.5mm,0)--(3.5mm,-{\dimexpr\ht\DefBox+\dp\DefBox+2\baselineskip})node[midway,right,shift={(3mm,0)}]{\usebox{\DefBox}};
\draw[ultra thick] (3.5mm,-{\dimexpr\ht\DefBox+\dp\DefBox+2\baselineskip}) --(0.7\wd\DefTitleBox,-{\dimexpr\ht\DefBox+\dp\DefBox+2\baselineskip});
\end{tikzpicture}
}

\begin{document}
\lipsum[1-2]
\begin{myDefi}
Test definition 

\[f(x)=3\cdot x -5\]
\end{myDefi}

\lipsum[1-2]

\begin{myDefi}
Test definition

\[f(x)=3\cdot x -5\]
where $x$ is something\ldots
\end{myDefi}

\lipsum[1-2]
\end{document}

enter image description here

2
  • Huge thanks for answering so quickly ! This is perfect ;-)
    – EWna
    Jun 26, 2021 at 21:06
  • 1
    Welcome @user245225 ... Happy TeXing... If you wish you may use the check-mark next to my answer to accept it as a solution to your question.
    – koleygr
    Jun 27, 2021 at 5:52
3

An easy way to do it is to use the package thmtools. It provides commands to put boxes around theorems, and one of the predefined box styles seems to be the same as in your example.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheorem[name=Définition, thmbox=M]{definition}
\begin{document}
\begin{definition}
Si \(E\) et \(F\) sont deux ensembles, l'ensemble de toutes les applications de \(E\) dans \(F\) est noté \(\mathcal{F}(E,F)\) ou encore \(F^E\).
\end{definition}
\end{document}

You must log in to answer this question.

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