![由类似地板的条形物分隔的环境](https://linux22.com/image/435809/%E7%94%B1%E7%B1%BB%E4%BC%BC%E5%9C%B0%E6%9D%BF%E7%9A%84%E6%9D%A1%E5%BD%A2%E7%89%A9%E5%88%86%E9%9A%94%E7%9A%84%E7%8E%AF%E5%A2%83.png)
答案1
欢迎来到 TeX.SX!
tikz
这是一种使用和包的方法environ
。
\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}
答案2
一个简单的方法是使用包thm工具它提供了将框放在定理周围的命令,其中一个预定义的框样式似乎与您的示例中的相同。
\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}