In LaTeX, you can process texts in different modes to achieve various formatting and layout effects. In this article, we will see the different modes used in LaTeX.
Different Modes for Processing Texts in LaTeX
When LaTeX processes your input text, it operates within one of three distinct modes:
- Paragraph mode
- Left-to-Right Mode (LR Mode)
- Math mode
1. Paragraph Mode
This is a common and most frequently used mode in LaTeX. This mode is designed for generating regular text with automated word-splitting and line and page breaking to ensure that the text fits within the specified width and height of a page.
2. Left-to-Right Mode (LR Mode)
In contrast to paragraph mode, LR mode processes text from left to right without word-splitting or line-breaking. Commands like \mbox{ }
or \fbox{ }
within LR mode can extend beyond the specified width of a page, allowing for unconventional text layouts.
3. Math Mode
Math mode is specifically intended for writing mathematical expressions, such as equations. It interprets and typesets mathematical expressions in this mode according to mathematical formatting rules. There are two types of math modes, i.e.,
- Inline math mode:
$…$
or\(…\)
. - Display math mode:
\[…\]
orequation
environment.
Paragraph mode and LR mode will occasionally be referred to as text mode. This term includes both modes that deal with the arrangement and presentation of textual content.
LaTeX transitions between these modes only during specific events, such as entering or exiting an environment or when processing the argument of certain text-producing commands. Mode changes occur within the scope of these events.
In creating boxes, LaTeX is in LR mode when initiating a box with the \mbox
command. Within such a box, it can be instructed to enter a different mode, such as math mode, for incorporating a mathematical formula.
Various text-producing commands and environments are designed to create boxes that place LaTeX in paragraph mode. The resulting box, generated by one of these commands or environments, is called a “parbox
.” When LaTeX is in paragraph mode while constructing a box, it is specifically termed “inner paragraph mode,” while its default paragraph mode is denoted as “outer paragraph mode.”