Written and maintained by CASRAI Editorial Board
Published
On this page
In LaTeX scientific publishing, dissertation formatting, and technical report drafting, documents are fully justified by default, and displayed mathematical formulas appear centered between the page margins. However, research manuscripts frequently require authors to align LaTeX left to comply with publisher guidelines, accommodate wide equation derivations, format multi-column articles, or typeset readable data tables.
This guide explains how to left align text, single equation blocks, and document-wide mathematical expressions using standard LaTeX2e commands, the American Mathematical Society (amsmath) package, and the ragged2e package. For guidance on centered layouts, consult our companions on centering in LaTeX and aligning LaTeX center.
What it is used for in research
Aligning content to the left margin serves critical editorial and structural functions in academic writing:
- Publisher and dissertation compliance: Many journal templates (such as those from IEEE, ACM, or university graduate schools) mandate flush-left equations (the
fleqnformat) to maximize horizontal space in two-column layouts. - Multi-step mathematical proofs: Long derivations, algorithmic definitions, and statistical model formulations often become unwieldy when centered. Aligning them flush-left anchors the starting terms at a predictable vertical axis, preventing formulas from clashing with right-hand equation numbers.
- Eliminating typographic rivers in narrow columns: In multi-column research layouts or narrow table cells, full justification forces LaTeX to stretch interword spacing unnaturally. Switching to left-aligned (ragged-right) text eliminates awkward gaps and hyphenation bottlenecks. For fine-grained horizontal adjustments, see our guide on spacing in LaTeX.
- Documenting code listings and data schemas: Research appendices containing pseudo-code, raw instrument parameters, and questionnaire inventories require left alignment to preserve structural indentation hierarchies, as detailed in our guide on indentation in LaTeX.
Install or access (official source only)
LaTeX tools and alignment packages are accessible through official TeX distributions and cloud drafting environments:
- TeX Live (Comprehensive TeX System): The official multi-platform distribution maintained by the TeX Users Group (TUG). Available at tug.org/texlive for Linux, macOS (MacTeX), and Windows. TeX Live includes standard classes and both the
amsmathandragged2epackages by default. - MiKTeX: An open-source TeX distribution for Windows, macOS, and Linux available at miktex.org featuring automatic package installation.
- Overleaf: An online collaborative LaTeX platform (overleaf.com) that operates TeX Live cloud instances without requiring local installation.
The standard environments flushleft and raggedright, as well as the fleqn class option, are built directly into the LaTeX2e core kernel. To use advanced equation alignment, load the amsmath package in your document preamble:
usepackage{amsmath}
To access improved hyphenation-aware text alignment, load the ragged2e package:
usepackage{ragged2e}
Step-by-step task
Follow these procedures to left align equations and text across your research document.
1. Left-align all document equations globally (fleqn option)
To align left LaTeX equations throughout your entire paper, pass the fleqn (flush equation) option to your document class in the preamble:
documentclass[fleqn]{article}
usepackage{amsmath}
Alternatively, pass fleqn directly when importing amsmath:
usepackage[fleqn]{amsmath}
Under fleqn, all displayed environments (such as equation, [ ... ], and align) align toward the left margin with a default indent controlled by the length mathindent. To make formulas align completely flush against the left text margin with zero indentation, set:
setlength{mathindent}{0pt}
2. Left-align a single equation block with flalign
If your document uses standard centered math, but you need a specific multi-line derivation to align left, use the flalign (or unnumbered flalign*) environment provided by amsmath. The name stands for “full-length alignment.”
To make the formulas align flush left, place an alignment symbol (&) before each equation and add an extra trailing & at the end of each row before the newline (\):
begin{flalign*}
& f(x) = alpha x^2 + beta x + gamma & \
& g(x) = 2alpha x + beta &
end{flalign*}
The trailing ampersand creates an empty right-hand column that absorbs all remaining horizontal page width, pushing the mathematical expression directly to the left margin. For more details on multi-line math structures, see our guide on aligned in LaTeX.
3. Left-align text paragraphs with flushleft and raggedright
To format body text with a ragged right margin, select between an environment and a declaration:
- The
flushleftenvironment: Use this for dedicated text blocks, such as callout boxes or author metadata. It starts a new paragraph and adds standard vertical space before and after the block:begin{flushleft} This section of research commentary is aligned to the left margin. Line breaks occur naturally without justification stretching. end{flushleft} - The
raggedrightdeclaration: Use this switch inside existing groups or custom macros without introducing extra vertical spacing. Always placeparbefore closing the group brace so LaTeX formats the paragraph unit before resetting scope:{ raggedright This paragraph is typeset with a ragged right margin inside an isolated group.par }
4. Improve ragged-right typography with ragged2e
Standard LaTeX raggedright completely disables hyphenation, which can create excessively uneven right margins in narrow columns. The ragged2e package preserves hyphenation while maintaining a clean left margin:
usepackage{ragged2e}
begin{FlushLeft}
This block uses hyphenation-enabled left alignment for smoother line breaks.
end{FlushLeft}
To set left alignment across the entire document while keeping hyphenation active, pass the document option in the preamble: usepackage[document]{ragged2e}.
5. Left-align columns in research tables
In tabular environments, format columns to align left using the l column descriptor:
begin{tabular}{llr}
hline
Variable & Definition & Sample Mean \
hline
Treatment & Binary intervention indicator & 0.52 \
Score & Standardized test score & 78.4 \
hline
end{tabular}
For fixed-width multi-line cells, combine the array package with ragged2e: >{RaggedRight}p{5cm}.
6. Migrating plain TeX display math ($$) to LaTeX
In older manuscripts, equations were often written using plain TeX delimiters: $$ ... $$. In modern LaTeX, the $$ syntax bypasses the LaTeX display math infrastructure. Consequently, $$ formulas ignore the fleqn class option and will remain centered or cause irregular vertical spacing. Replace all occurrences of $$ ... $$ with standard LaTeX delimiters: [ ... ] or begin{equation*} ... end{equation*}.
Output and how to read it
Compiling your document with these alignment settings produces specific visual structures:
- Global fleqn equations: Displayed formulas begin at the designated
mathindentdistance from the left margin rather than floating in the page center. Equation numbers remain anchored at the right margin (or left margin if theleqnooption is activated). - flalign equation blocks: The leading mathematical symbols align precisely against the left margin boundary, while intermediate relation signs (such as equals signs) align at internal
&tab stops. - Ragged-right text: The left margin maintains a crisp, uniform straight edge. Words on the right end naturally without interword letter-spacing distortion. When using
ragged2e, occasional standard hyphens will appear at line breaks to optimize margin balance.
Troubleshooting
Address common LaTeX left-alignment defects with these verified solutions:
- Equations remain centered despite using fleqn: Verify whether formulas use
$$ ... $$. Replace double dollar signs with[ ... ]orbegin{equation}. Additionally, check thatfleqnis specified before package calls that redefine math environments. - raggedright leaks into following paragraphs: The
raggedrightcommand is a state switch, not an isolated block. If placed outside an explicit group, it affects all subsequent text. Enclose the command within braces and end withpar:{raggedright ...par}. - flalign centers or leaves irregular gaps: If you omit the trailing ampersand in
flalign*, LaTeX splits horizontal space evenly between equation columns. Always place an extra&at the end of each equation line before\to push formulas to the far left. - Option clash for package amsmath: This occurs if a document class (or another package) loads
amsmathwithout options and your preamble later callsusepackage[fleqn]{amsmath}. Resolve this by passingfleqnglobally indocumentclass[fleqn]{...}. - Right margin looks excessively ragged: Standard LaTeX
raggedrightturns off hyphenation. In narrow columns, this creates unsightly line breaks. Loadusepackage{ragged2e}and switch toRaggedRightor theFlushLeftenvironment.
Free alternatives (table)
Compare the standard LaTeX methods for left-aligning document elements:
| Command or Environment | Package Source | Target Scope | Hyphenation Active | Primary Research Use Case |
|---|---|---|---|---|
documentclass[fleqn]{article} |
LaTeX2e Kernel | Document-wide equations | N/A (Math) | Standard journal formatting requiring all formulas flush left |
begin{flalign*} |
amsmath |
Single equation block | N/A (Math) | Left-aligning specific derivations while keeping document centered |
begin{flushleft} |
LaTeX2e Kernel | Paragraph block | No | Author affiliations, notes, and callout sections |
raggedright |
LaTeX2e Kernel | Group or table cell | No | Narrow table cells (p{...}) and minipages |
RaggedRight / FlushLeft |
ragged2e |
Group, block, or document | Yes | Multi-column body text, dissertations, and long descriptive cells |
l column descriptor |
LaTeX2e Kernel | Tabular column | N/A | Left-aligning text or categorical data within data tables |
FAQ
How do I left-align an equation in LaTeX without changing the whole document?
To left-align a single equation in an otherwise centered document, use the flalign* environment from amsmath. Place an ampersand (&) at the start of your formula and a trailing ampersand (&) at the end of the line before \. The trailing ampersand forces LaTeX to push the formula completely against the left margin.
Why does LaTeX $$ left align not work with fleqn?
The double dollar sign syntax ($$ ... $$) is a legacy plain TeX primitive that bypasses LaTeX2e display math management. Because TeX processes $$ independently of LaTeX class parameters, it ignores fleqn and the mathindent length. In modern LaTeX, always use [ ... ] or begin{equation*} ... end{equation*} to ensure formulas respect flush-left settings.
What is the difference between flushleft and raggedright?
The flushleft command is an environment (begin{flushleft} ... end{flushleft}) that initiates a new paragraph and adds vertical margin space before and after the block. In contrast, raggedright is a declaration switch that changes paragraph alignment within the current group or environment without adding extra vertical margins.
How do I remove the left indent on fleqn equations?
When the fleqn option is active, LaTeX sets formulas with a default left indent determined by the length parameter mathindent. To align equations strictly against the left text margin with zero offset, add setlength{mathindent}{0pt} in your document preamble after loading amsmath.
How can I left-align text in a LaTeX table cell?
For standard single-line table columns, specify the l column type in begin{tabular}{l...}. For fixed-width cells that wrap across multiple lines, use the array package and specify >{RaggedRight}p{width} (with ragged2e) to prevent awkward word spacing while preserving proper hyphenation.
Sources (official docs)
- LaTeX2e: An unofficial reference manual. Chapters on “flushleft”, “raggedright”, “Document class options”, and “displaymath”. URL: https://latexref.xyz/
- American Mathematical Society. User’s Guide for the amsmath Package (Version 2.1). CTAN archive: https://ctan.org/pkg/amsmath / Direct documentation: https://ctan.org/tex-archive/macros/latex/required/amsmath/amsldoc.pdf
- Overleaf Documentation. “Aligning equations with amsmath” and “Text alignment”. URLs: https://www.overleaf.com/learn/latex/Aligning_equations_with_amsmath and https://www.overleaf.com/learn/latex/Text_alignment







