What's the difference between \strut, \mathstrut and \vphantom? When would I prefer one of them to the others, and why?
|
Each are defined as follows in the default document classes (
|
You should note that \strut is updated by every font size changing command (\large, \small and so on). What you say about "font dependency" is not very clear, IMO. – egreg Jan 15 '12 at 21:56 |
|
@Werner -- \mathstrut is often better in math than \strut. which one is better depends on the local context. – barbara beeton Jan 15 '12 at 22:16 |
|
And it is worth mentioning that the height of boxes in \fbox{\strut g}\fbox{\strut \"A} are not equal because \strut does not automatically detect the highest and deepest characters in the active character set. – Click Me Mar 31 at 3:12 |
|
The The
|
||||
|
|
\vphantomtakes some content and produces the same vertical size, while\strutalways inserts a font-size specific but otherwise fixed amount. – Martin Scharrer♦ Jan 15 '12 at 21:33