Open main menu


The \rule command in normal use produces a simple black box:


The parameter thickness determines the height, whereas width determines the width of the produced rule. With the optional parameter raise, you can optionally raise or lower the produced rule above or below the baseline.

Here is an example (the thin lines are located at the baseline):



This is useful for drawing vertical and horizontal lines.


A special case is a rule with no width but a certain height. In professional typesetting, this is called a strut. It is used to guarantee that an element on a page has a certain minimal height. You could use it in a tabular environment or in boxes to make sure a row has a certain minimum height.

In LaTeX a strut is defined as


Stretched rulesEdit

LaTeX provides the \hrulefill command, which work like a stretched horizontal space. See the Lengths chapter.

Previous: Boxes Index Next: Mathematics