\sbox from inside an environment

Posted by Miek Gieben on Stack Overflow See other posts from Stack Overflow or by Miek Gieben
Published on 2010-06-01T18:00:46Z Indexed on 2010/06/01 18:03 UTC
Read the original article Hit count: 137

Filed under:

I'm trying to save some text inside an environment for later use. The smallest test case I could come up with is this. The saved text in the sbox isn't available after the environment is closed. How can I work around that? Thanks.

\documentclass{article}
\begin{document}
\newsavebox{\somebox}
\begin{itemize}
\item hello1
\item hello1 \sbox{\somebox}{Some text}
\end{itemize}
This should show something, but does not: "\usebox{\somebox}"
\end{document}

© Stack Overflow or respective owner

Related posts about latex