# Deep brackets around a text

What I'm trying to achieve is to get the following effect for a body of text:

.

I've looked at many examples that use all sort of brackets, but none of them look like the ones above. So far, I've only managed to get a simple frame using mdframed, but that's far from what I hope to get.

\documentclass{memoir}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}
\usepackage{fullpage}

\begin{document}
\begin{mdframed}
\lipsum[1]
\end{mdframed}
\end{document}


Any ideas?

-
Take a look at mdframed : ctan.org/tex-archive/macros/latex/contrib/mdframed –  projetmbc Feb 11 '14 at 22:48

You have, at least two options allowing page breaks inside the framed text. You can use the tcolorbox package:

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{most}
\usepackage{lipsum}

\newtcolorbox{mybox}{
freelance,
breakable,
frame code={
\draw
([xshift=2cm]frame.north west) --
(frame.north west) --
(frame.south west) --
([xshift=2cm]frame.south west);
\draw
([xshift=-2cm]frame.north east) --
(frame.north east) --
(frame.south east) --
([xshift=-2cm]frame.south east);
},
colback=white
}

\begin{document}

\lipsum[4]
\begin{mybox}
\lipsum[4]
\end{mybox}
\lipsum[4]

\end{document}


or you can use the mdframed package:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newmdenv[
hidealllines=true,
singleextra={
\draw
([xshift=2cm]O) --
(O) --
(O|-P) --
([xshift=2cm]O|-P);
\draw
([xshift=-2cm]P) --
(P) --
(P|-O) --
([xshift=-2cm]P|-O);
},
firstextra={
\draw
(O) --
(O|-P) --
([xshift=2cm]O|-P);
\draw
([xshift=-2cm]P) --
(P) --
(P|-O);
},
middleextra={
\draw
(O) --
(O|-P);
\draw
(P) --
(P|-O);
},
secondextra={
\draw
([xshift=2cm]O) --
(O) --
(O|-P);
\draw
(P) --
(P|-O) --
([xshift=-2cm]P|-O);
},
]{mybox}

\begin{document}

\lipsum[4]
\begin{mybox}
\lipsum[4]
\end{mybox}
\lipsum[4]

\end{document}


-
Boy, you're fast! This is a perfect solution - THANK YOU. –  m0squito Feb 5 '14 at 3:59
@m0squito You're welcome! I edited my answer adding the breakable key, so page breaks are allowed inside the environment. –  Gonzalo Medina Feb 5 '14 at 4:02
That's even better, thank you very much! –  m0squito Feb 5 '14 at 4:03
@m0squito I added another option to my answer, this time using mdframed. Both options will admit page breaks, but the behaviour of the frame when it spans several pages is different as I set the environments; one can easily modify either of the examples to get the same resul as with the other. –  Gonzalo Medina Feb 5 '14 at 4:19

Here I make \specbox a macro, rather than an environment, which means that the bracketed text cannot break across a page. One uses \fboxsep and \fboxrule to define the bracket offset and thickness, and \bracketarm to define the length of the bracket arm.

I use \xcolor and stackengine packages to essentially stack white centered rules above and below \frameboxed text.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\usepackage{xcolor}
\usepackage{lipsum}
\newlength\bracketarm
\newlength\fbrp
\fboxsep 2ex
\fboxrule 2pt
\bracketarm 1in
\setlength{\fbrp}{\fboxrule+1pt}
\newcommand\specbox[1]{%
{\centering\noindent\setstackgap{S}{-\fbrp+0.5pt}%
\stackon{%
\stackunder{\framebox{\parbox{\textwidth-2\fboxsep-2\fboxrule}{#1}}}%
{\color{white}\rule{\textwidth-2\bracketarm}{\fbrp}}%
}{%
\color{white}\rule{\textwidth-2\bracketarm}{\fbrp}%
}}}%
\parskip 1ex
\begin{document}
\lipsum[1]

\specbox{\lipsum[2]}

\lipsum[3]
\end{document}


-