# l3coffins — Wrong width if the coffin contents is a list

In the example below you see that the coffin with the input enumerate has the wrong with. I can fix this by using \@parboxrestore.

1. Is there an expl3-solution?
2. Should this solution be the default for coffins?

\documentclass{article}
\usepackage{xcolor}
\usepackage{kantlipsum}
\begin{document}
\ExplSyntaxOn
\coffin_new:N \l_xframed_store_one_coffin

\NewDocumentEnvironment { xframed } { }
{
\vcoffin_set:Nnw \l_xframed_store_one_coffin { .7\linewidth }
}
{
\vcoffin_set_end:
\fboxsep0pt\fbox{\coffin_display_handles:Nn \l_xframed_store_one_coffin { red }}
}
\ExplSyntaxOff

\begin{xframed}
\kant[2]
\end{xframed}

\begin{xframed}
\begin{enumerate}
\item foo
\item bar \verb+1+
\end{enumerate}
\end{xframed}

\makeatletter
\begin{xframed}
\@parboxrestore
\begin{enumerate}
\item foo
\item bar \verb+1+
\end{enumerate}
\end{xframed}

\end{document}

-

## 1 Answer

The fix does not actually need all of \@parboxreset: a simple

\linewidth\hsize


will do it. Probably we need to alter this in l3coffins as unless the LaTeX3 l3galley module is loaded then there is nothing to alter \linewidth in the coffin code.

-
Indeed! l3galley does it. In this case I must use it. – Marco Daniel May 28 '12 at 15:55
@MarcoDaniel My point is that l3galley can't really be loaded with 'unmodified' LaTeX2e files, but l3coffins can. So we should make sure that the coffins code covers this case in package mode. – Joseph Wright May 28 '12 at 15:58
I noticed this. If l3galley is loaded, I can't work with \linewidth. – Marco Daniel May 28 '12 at 16:02
I've updated the SVN to fix this: will be in the next CTAN snapshot in June. – Joseph Wright May 28 '12 at 19:57