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

Gene
  • 55

1 Answers1

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.

Heiko Oberdiek
  • 271,626