[Tex/LaTex] Remove extra space from framed environment

enumitemframedhorizontal alignmentspacing

I would like to remove or better said have the framed environment (box) aligned with the content in the description. Notice below how the box is out of alignment and aligns with the margin. See a MWE:

enter image description here

\documentclass[letterpaper]{article}
\usepackage{framed}
\usepackage{enumitem}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
    \begin{description}
    \item[Test] \lipsum[1]
    \begin{framed}
        \textbf{Understanding the Problem}
    \begin{enumerate}
        \item[0:] Complete misunderstanding of the problem
        \item[5:] Part of the problem misunderstood or misinterpreted
        \item[10:] Complete understanding of the problem
    \end{enumerate}
    \end{framed}
    \end{description}
\lipsum[1]
\end{document}

Best Answer

Here's one possibility, using the framed environment from the framed package as requested:

\documentclass[letterpaper]{article}
\usepackage{framed}
\usepackage{enumitem}
\usepackage{lipsum}

\makeatletter
\renewenvironment{framed}{%
 \def\FrameCommand##1{\hskip\@totalleftmargin
 \fboxsep=\FrameSep\fbox{##1}
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}%
 {\par\unskip\endMakeFramed}
\makeatother

\begin{document}
\lipsum[4]
    \begin{description}
    \item[Test] \lipsum*[1]
    \begin{framed}
        \textbf{Understanding the Problem}
    \begin{enumerate}
        \item[0:] Complete misunderstanding of the problem
        \item[5:] Part of the problem misunderstood or misinterpreted
        \item[10:] Complete understanding of the problem
    \end{enumerate}
    \end{framed}
    \end{description}
\lipsum[4]
    \begin{framed}
        \textbf{Understanding the Problem}
    \begin{enumerate}
        \item[0:] Complete misunderstanding of the problem
        \item[5:] Part of the problem misunderstood or misinterpreted
        \item[10:] Complete understanding of the problem
    \end{enumerate}
    \end{framed}
\end{document}

enter image description here

Related Question