Update:
As requested, an environment for "hooked" text. The syntax is:
\begin{hooked}[<optional line configuration (TikZ syntax)>]%
{<Hook length (below horizontal rule)>}%
{<The amount the hook advances to the margin>}%
{<The space between the hook and the text>}
Text
\end{hooked}
I added a space between the hook and the text. It looks better with a little space.
The code:
\newenvironment{hooked}[4][line width=1pt]{% Default line appearance
\noindent\hspace{-#3}% Drag the hook left by \hookmargin
\begin{tikzpicture}% Draw the opening hook
% V---V Why can't use 2#3 instead of #3+#3?
\draw [#1] (0,-#2) -- (0,0) -- (\linewidth+#3+#3,0) -- (\linewidth+#3+#3,-#2);
\end{tikzpicture}%
\par% We need a \par to avoid text in the same line as the rules (thanks @Werner!)
\vspace{#4}% Add a space between the hook and the text
\def\closehook{% Defining a closing hook (for some reason, putting this in the \end{hooked} definition doesn't work)
\par% And another \par here!
\vspace{#4}% Add the same sspace as before
\noindent\hspace{-#3}% Doing the same...
\begin{tikzpicture}
\draw [#1] (0, #2) -- (0,0) -- (\linewidth+#3+#3,0) -- (\linewidth+#3+#3, #2);
\end{tikzpicture}%
}%
}{%
\closehook% Inserting the closing hook
}
MWE:
\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}
\newenvironment{hooked}[4][line width=1pt]{%
\noindent\hspace{-#3}%
\begin{tikzpicture}
\draw [#1] (0,-#2) -- (0,0) -- (\linewidth+#3+#3,0) -- (\linewidth+#3+#3,-#2);
\end{tikzpicture}\par\vspace{#4}%
\def\closehook{%
\par\vspace{#4}\noindent\hspace{-#3}%
\begin{tikzpicture}
\draw [#1] (0, #2) -- (0,0) -- (\linewidth+#3+#3,0) -- (\linewidth+#3+#3, #2);
\end{tikzpicture}%
}}{\closehook}
\begin{document}
\begin{hooked}[line width=1pt, blue, dash dot]{2em}{2em}{-1em}
\lipsum[1-5]
\end{hooked}
\end{document}
My previous answer:
Using TikZ:
\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}
\newlength{\hooklength}
\setlength{\hooklength}{1em}% The length of the hook below the horizontal rule
\newlength{\hookmargin}
\setlength{\hookmargin}{2em}% The amount the hook enters the margin to each side
\newlength{\hookwidth}
\setlength{\hookwidth}{1pt}% The thickness of the rules
\newcommand{\hookdown}{%
\noindent\hspace{-\hookmargin}%
\begin{tikzpicture}
\draw [line width = \hookwidth] (0,-\hooklength) -- (0,0) -- (\textwidth+2\hookmargin,0) -- (\textwidth+2\hookmargin,-\hooklength);
\end{tikzpicture}%
}
\newcommand{\hookup}{%
\noindent\hspace{-\hookmargin}%
\begin{tikzpicture}
\draw [line width = \hookwidth] (0,\hooklength) -- (0,0) -- (\textwidth+2\hookmargin,0) -- (\textwidth+2\hookmargin,\hooklength);
\end{tikzpicture}%
}
\begin{document}
\hookdown
\lipsum[1]
\hookup
\end{document}

theoremenvironment – Werner Jan 12 '18 at 21:15