Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
Short answer: LaTeX has no tab key. A Tab character typed in the source file is treated as ordinary whitespace, so to get tab-like behaviour you pick a command for the job: the tabbing environment for text aligned on tab stops, \quad or \hspace for an inline gap, tabular for a data grid, or the tabto package, which adds a \tab command and named tab positions. This page is for researchers and analysts who typeset documents in LaTeX and need to line text up. By the end you should be able to choose the right command and write a working tabbing block.
What a tab means in LaTeX (and “tab in LaTeX”)
The LaTeX2e reference manual describes the tabbing environment as a way to “align text in columns, by setting tab stops and tabbing to them much as is done on a typewriter.” That typewriter model is the closest thing LaTeX has to the “tab in LaTeX” people search for. The table below maps what you probably want to the command that does it.
| What you want | Use | Source |
|---|---|---|
| A first-line indent at the start of a paragraph | Nothing to type; see indentation in LaTeX | CASRAI guide |
| A horizontal gap inside a line | \quad or \hspace{...}; see spacing in LaTeX |
CASRAI guide |
| Text aligned on typewriter-style tab stops (code listings, aligned lines) | tabbing environment |
LaTeX2e reference manual |
| A grid of data in rows and columns | tabular or array |
LaTeX2e reference manual |
| Jump to a measured distance from the left margin, or use named tab stops across a paragraph | \tabto, \TabPositions and \tab from the tabto package |
CTAN |
Install or access
The tabbing environment is part of core LaTeX, so no package is needed. The tabto package (version 1.4 on CTAN, maintained by Donald Arseneau, licensed under the LaTeX Project Public License 1.3) is described on CTAN as “Tabs to a measured position in the line”. Load it in the preamble with \usepackage{tabto}. Its CTAN page is ctan.org/pkg/tabto.
Step by step: build a tabbing block
- Open the environment. Write
\begin{tabbing}and close it with\end{tabbing}. - Set tab stops with
=. Place=at each position where a tab stop should sit. A tab stop i can only be set if stops 0 to i-1 are already set. - Move between stops with
>. Write>to advance to the next tab stop on the current line. - End each row with
\\. - Optionally, define the stops on a throwaway line with
\kill. A row ending in\killinstead of\\sets tab stops without printing any text, which works like a ruler line.
\begin{tabbing}
Parameter = Participants = Unit \kill
Parameter > Value > Unit \\
alpha > 0.05 > (none) \\
n > 120 > participants \\
\end{tabbing}
The first row only defines the stops, using the widest text for each column, and is discarded by \kill. The remaining rows start at those stops.
Other tabbing commands from the manual
+moves the left margin of the next and following lines one tab stop to the right;-undoes one+(it does not change the current line).<puts the following text to the left of the local margin; it works only at the start of a line and requires that a preceding line used+.\'moves everything in the current column so far to the previous column, aligned right against the current column’s tab stop.\`moves all following text, up to the\\or\end{tabbing}, flush right. No>or'may come between it and the end of the line, and it cannot move text past the last column.\pushtabssaves the current tab stops and\poptabsrestores those saved by the last\pushtabs.
The tabto alternative
With tabto loaded, \tabto{2cm} moves to 2 cm from the paragraph’s left margin; if the text is already past that point it starts a new line. \tabto* moves backwards, which may overwrite earlier text. \TabPositions defines a list of stops and \tab then advances to the next defined stop.
Output and how to read it
tabbing sets plain text lines, not a bordered table: the text that follows each > starts at the stop set by the matching = on an earlier line. If a column looks misaligned, check that the stops were set on a line wide enough to define every column, which is the job of the \kill line. Use tabular instead when you need rules, column alignment options or a table caption; the reference manual notes that tabbing is used less often than tabular.
Troubleshooting
“Undefined control sequence” on tab
\tab is not a standard LaTeX command. It exists only after you load tabto. Without the package, LaTeX reports an undefined control sequence.
Accents break inside tabbing
Inside tabbing, the accent commands \=, \' and \` are taken over for tab functions, so they no longer produce accents. Use \a=, \a' and \a` instead.
A tab stop does nothing
Tab stop i can only be set if stops 0 to i-1 are already set. Set them left to right on the same line.
Error when used in a moving argument
The manual lists the tabbing commands as fragile; protect them with \protect when they appear inside a moving argument such as a section title.
Free alternatives
Every option here is free and part of core LaTeX or CTAN. The right one depends on the layout.
| Option | Best for | Where it comes from |
|---|---|---|
tabbing |
Typewriter-style aligned lines on tab stops | Core LaTeX |
tabular / array |
Data grids; column widths need not be known in advance | Core LaTeX |
\quad, \hspace |
A fixed inline gap (see spacing in LaTeX) | Core LaTeX |
tabto package |
Moving to a measured position or named stops in running text | CTAN package, LPPL 1.3 |
For tables with merged cells, see multirow in LaTeX; for vertical alignment, see centering a LaTeX table vertically. For list structure, see the item command in LaTeX.
FAQ
How do I add a tab in LaTeX?
Use the command that matches your layout: tabbing for tab stops, \quad or \hspace for an inline gap, or \tabto from the tabto package for a measured position. Pressing the Tab key in the editor only inserts whitespace.
What is a tab in LaTeX?
There is no built-in tab character. The nearest equivalent is a tab stop in the tabbing environment, set with = and reached with >.
Why does tab give an error?
Because \tab belongs to the tabto package, not to LaTeX itself. Add \usepackage{tabto}.
Should I use tabbing or tabular?
Use tabular for data tables. The reference manual describes tabbing as less often used than tabular; it suits text aligned like a typewriter, such as code.
Sources
- LaTeX2e: An unofficial reference manual, “tabbing” and “tabbing commands” sections, HTML mirror at latexref.xyz/tabbing.html and latexref.xyz/tabbing-commands.html (read 2026-11-08).
- CTAN, tabto package page (read 2026-11-08).







