Hi, i'm trying to create some personalized color-box using TikZ and PGF. What i want to do is pass the text to the macro and that the color-box calc it's own "text width".
I done this parcially using an lrbox:
Code: Select all
\begin{lrbox}{\capbox}\footnotesize#1\end{lrbox}%
\settowidth{\capwidth}{\usebox{\capbox}}%
With this in \capwidth i have the width of the text. Which works fine if the text that i pass to the macro is "example, word, jhon doe". But if i pass something like: "example \\ word \\ jhon" if tails. This is because lrbox works in LR-mode (only one line). My question is, exist a way for "calculate" the textwidth of a Paragraph-mode text?
P.S: \parbox{}{} works for "paint" a box, but i need to store the box on a command to later extract the width.
Thanks!