LaTeX commands | LaTeX manual | Aspose.TeX for Java
Another way to build complex formulas from simple ones is to use the commands \sqrt
, \underline
, or \overline
. They also apply to the character or subformula that follows them:
You can also get cube roots and similar things:
These three commands place lines above and below subformulas of any size and shape; the bar lines change their size and position, so that they are long enough to cover the subformula, and high enough or low enough not to overlap with it. In particular, square root signs appear in a variety of positions depending on the height and depth of what’s being \sqrt
‘ed:
In such a case, you may want to typeset all square roots uniformly, like this:
The easy way to do this is to use the command \mathstrut
:
1$\sqrt{\mathstrut a} + \sqrt{\mathstrut d} + \sqrt{\mathstrut y}$.
A \mathstrut
is an invisible zero-width box. Its height and depth are the height and depth of a parenthesis ‘(’. It follows that subformulas that contain \mathstrut
will always have the same height and depth, unless they involve more complicated constructions like subscripts and superscripts.