1

Please have a look at this mininal example

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{framed}

\title{Box}
\author{LR}
\date{September 2020}

\begin{document}

\section{Introduction}
\blindtext

\begin{framed}
\blindtext
\end{framed}
%\medskip\noindent
%\setlength{\fboxsep}{1mm}
\fbox{
    \parbox{\textwidth}{
        \blindtext
        }%
    }%
%\medskip
\end{document}

As you can see see both tries resulted in the space available for the text being somewhat compressed. I would like instead the box to have a larger width such that the text retains its original breaking line points, is it possible?

1
  • I believe the mdframed package specializes in placing frames outside the text area. Or you can increase the effective width of the text area using (negative) \leftskip and \rightskip. Commented Sep 7, 2020 at 14:57

1 Answer 1

1

You can try something like this, based on tcolorbox library. I don't know how to use a larger default frame; consequently, I hide it and create a new one with tikz.

enter image description here

\documentclass[11pt, a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}

% \usepackage{showframe}
\usepackage{lipsum}

\newenvironment{Bbox}{%
  \tcolorbox[%
  empty,
  parbox=false,
  noparskip,
  enhanced,
  breakable,
  frame hidden, % default frame hidden
  boxrule=0pt, % default frame hidden
  colback=white,
  left=-4pt, right=-4pt,
  before skip=4ex plus 2pt,
  after skip=3.5ex plus 2pt,
  overlay unbroken and last={% new frame
    \draw[color=blue, line width=1.25pt]
    ($(frame.north west)+(-1em, .5ex)$)
    rectangle ($(frame.south east)+(1em, -.5ex)$);
  }]
}{\endtcolorbox}


\title{Using tcolorbox package}
\begin{document}
\maketitle

\lipsum[1]

\begin{Bbox}
  \lipsum[2]
\end{Bbox}

\lipsum[3]

\end{document}

You must log in to answer this question.

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