\settowidth
needs \usebox
!
\newsavebox{\mybox}
\sbox{\mybox}{hello world!}
\newlength{\myboxlen}
\settowidth{\myboxlen}{\usebox{\mybox}}
\noindent
\rule{\myboxlen}{1pt}\\
\usebox{\mybox}
box size: \the\myboxlen.
advanced computations are possible using the
calc
package.
2 comments:
Thank you! Just what I looked for!
Man, you just saved my life!
Post a Comment