Payload LogoOctree

Text Alignment in LaTeX: Centering, Flushing, and Justification

Date Published

Text Alignment in LaTeX

Control how your text is positioned on the page with LaTeX's alignment options.

Centered Text

Using the center Environment

\begin{center} This text is centered. \end{center}

Using \centering

Inside a group or environment:

{\centering This text is centered.\par}

Note: Always end with \par or a blank line when using \centering.

Centerline (Single Line)

\centerline{This line is centered}

Best for single lines only.

Left-Aligned (Flush Left)

Using the flushleft Environment

\begin{flushleft} This text is left-aligned. \end{flushleft}

Using \raggedright

{\raggedright This text is left-aligned.\par}

Right-Aligned (Flush Right)

Using the flushright Environment

\begin{flushright} This text is right-aligned. \end{flushright}

Using \raggedleft

{\raggedleft This text is right-aligned.\par}

Justified Text (Default)

LaTeX justifies text by default—aligned on both left and right margins.

To restore after changing:

{\justifying This text is fully justified.\par}

Requires \usepackage{ragged2e}

Alignment in Tables

Column Alignment

\begin{tabular}{l c r} — left, center, right columns

Cell Alignment

Use \multicolumn for individual cells:

\multicolumn{1}{c}{centered cell}

Alignment in Equations

Centered Equations (Default)

\begin{equation} centers equations automatically.

Aligned Equations

Use align for multi-line with alignment points:

\begin{align} x &= 1 + 2 \\ &= 3 \end{align}

The & marks alignment points.

Left-Aligned Equations

\usepackage[fleqn]{amsmath}

This makes all equations flush left.

Paragraph Alignment

Hanging Indent

\hangindent=2em \hangafter=1

First line normal, rest indented.

No Indent

\noindent This paragraph has no indent.

Or globally: \setlength{\parindent}{0pt}

Vertical Alignment

In Minipages

\begin{minipage}[t]{0.5\textwidth} — top

\begin{minipage}[c]{0.5\textwidth} — center

\begin{minipage}[b]{0.5\textwidth} — bottom

In Table Cells

Use m{width} for middle alignment:

\begin{tabular}{m{3cm} m{3cm}}

Requires \usepackage{array}

Common Use Cases

Centered Title Page

\begin{titlepage} \centering \vspace*{2cm} {\Huge Title} \end{titlepage}

Right-Aligned Signature

\begin{flushright} Sincerely,\\ Your Name \end{flushright}

Block Quote

\begin{quote} Indented on both sides. \end{quote}

Align Text with Octree

Octree makes alignment easy:

- Visual alignment controls - Preview changes instantly - AI suggests proper environments - Clean, professional results

Try it at https://useoctree.com