What you're running into here is a scoping issue. In (La)TeX, you can introduce scopes with { ... }
, \bgroup ... \egroup
, or \begingroup ... \endgroup
. The former two are roughly the same, as \bgroup
and \egroup
are defined by \let\bgroup{
and \let\egroup}
; the last one is slightly different. But the scoping property is the same: any commands, boxen, etc., created or modified within those scopes are not visible outside. And in LaTeX, all environments \begin{env} ... \end{env}
implicitly wrap their contents in \begingroup ... \endgroup
. This means that your\sbox{\somebox}{Some text}
modification is only visible until the \end{itemize}
; after that, the modification is undone. To get around this, prepend any command like \newcommand
, \def
, \newsavebox
, \sbox
, etc., with \global
, which forces the definition to take place at the global scope and be visible everywhere.
Also, to use quotes in (La)TeX, write ``double quoted''
, ``double quoted"
, or `single quoted'
; the "
character is only for closing quotes, not opening quotes. Putting this all together gives you the revised snippet
\documentclass{article}
\begin{document}
\newsavebox{\somebox}
\begin{itemize}
\item hello1
\item hello1 \global\sbox{\somebox}{Some text}
\end{itemize}
This should show something, and in fact does: ``\usebox{\somebox}''
\end{document}