Can anyone explain me the fine details of the \strut macro. Why is the box \copyied in mathmode but \unhcopyied otherwise?
% latex.ltx, line 484, but identical in plainTeX
\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
The TeXBook states (e.g. page 120) that the unboxing macros unset any glue in the box's outer level, but there is no glue in the \strutbox, is it?
I understand that \strutbox is an actually empty box with a font size dependent height (.7\baselineskip, where \baselineskip is about 1.2x font size) and depth (.3\baselineskip) but zero width:
% latex.ltx, line 2357, inside the `\set@fontsize` macro
\setbox\strutbox\hbox{%
\vrule\@height.7\baselineskip
\@depth.3\baselineskip
\@width\z@}%
I assume it is more efficient to use a box instead of repeatably use \vrule. Also you can use \ht\strutbox and \dp\strutbox to access the height and depth as dimensions. This allows you to write .5\ht\strutbox while .5*.7\baselineskip would require eTeX's \dimexpr or a temporal assignment.
I really like to understand the fine nuances of TeX better.