Deep Brackets Around a Text

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}

enter image description here

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}

enter image description here


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}

enter image description here

Tags:

Brackets