Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

enter image description here

\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}
share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.