1

I can get the height of the hbox but I am stuck trying to double its height. Here my latex statements:

\newlength{\txtlineheight}
\settoheight{\txtlineheight}{\hbox{Hello World!}}
\settoheight{\txtlineheight}{\txtlineheight*2}

Any help would be appreciated

2

Are you looking for \setlength?

\newlength{\txtlineheight}
\settoheight{\txtlineheight}{Hello World!}
\setlength{\txtlineheight}{2\txtlineheight}

Also, \settoheight already puts its argument into a box, thus the \hbox is superfluous.

If calculations are needed, package calc can be loaded. But this is not necessary for doubling, because 2 can be used as factor for the length.

Another way for calculations is available with e-TeX's \dimexpr.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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