\ifdim\wd0>\wd2 \dimen0 \wd0 \else \dimen0 \wd2 \fiOf course, this works perfectly well. But sometimes, you want something that's a little less easy to read. Thus, I propose
\dimen0 \wd\ifdim\wd0>\wd2 0 \else2 \fiThe spaces around the numbers are to keep TeX from reading more input looking for additional digits.
There is another way calculate the maximum width of any number of boxes.
ReplyDelete\setbox0=\hbox{\kern 26pt}
\setbox1=\hbox{\kern 16pt}
\setbox2=\hbox{\kern 33pt}
\setbox3=\vbox{\copy0 \copy1 \copy2}
\showthe\wd3