# How to frame multiple lines with a box and not alter text width

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 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?

• 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. Sep 7 '20 at 14:57

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.

\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}