# Using the \tab Command

I have seen several cases of people using the \tab command to insert a specific amount of space between objects (as opposed to the \hfill command which uses any remaining space). However, I have never been able to get \tab to work. Are there any specific packages or environments that are supposed to accompany \tab?

• I am not familiar with \tab, but there is a tabto package that can come in quite handy. Aug 29 '14 at 1:04
• I would use \hspace*{<length>} -- without the * the full space may not be inserted.
– user30471
Aug 29 '14 at 4:20
• May be \let\tab\quad? Aug 29 '14 at 6:27

The command \tab exists, but it produces quite a large space. It also requires the use of the package tabto.

Alternative options are \quad and \qquad; the space produced is probably more what you are looking to create. These commands do not require extra packages and can be stacked (e.g. Stuff Over Here \quad \quad \quad More Stuff Over Here) if needed.

You might also want to try using either $\>$ or $\-$. Neither command requires any extra packages, but both must be in math mode. Although neither command by itself gives a large space like \tab does, the space produced is small. However, you can stack the commands in order to get the spacing you want.

Hope this helps.

• @Manuel You are correct; I could define a term like Herbert wanted. But that doesn't really solve the problem or answer the question. The objective is to find a command that will put space between objects and defining a new command doesn't really do that. Besides, it's bad form to define a new command in each document. Oct 23 '14 at 22:24
• Oh, I see what you're saying. But, as I mentioned previously, the objective is to FIND a command that will put space between objects and defining a new command doesn't really do that. There is no point in creating a command if one already exists, making it unnecessary (what I term "bad form") to define a new command in each document. Oct 23 '14 at 23:00
• This doesn't align the text as far as I can tell. It just inserts a fixed width space. Mar 1 at 20:05

\documentclass{article}
\newcommand\tab[1][1cm]{\hspace*{#1}}
\begin{document}
foo\tab bar\tab[2cm]baz

\tab foo\tab bar\tab[2cm]baz

\rule{1cm}{1pt}foo\rule{1cm}{1pt}bar\rule{2cm}{1pt}baz

\end{document}

• Which is not what \t does. Tab also aligns the text. Jan 24 '17 at 19:17

Instead of \tab, you may use \hspace{10mm} which gives a 10mm space similar to using \tab.

If instead of wanting to insert a predetermined amount of spacing within a line, you want to insert variable space that reaches the next predefined tab stop to automatically align across lines like a traditional text editor tab, you may use \NumTabs{⟨number⟩} and \tab from the tabto package as so:

\NumTabs{8} % define 8 equally spaced tabs starting at the left margin
% and spanning \linewidth
\begin{itemize}
\item\textbf{Dolphin}:\tab Delphinidae, Platanistidae, Iniidae, Pontoporiidae
\item\textbf{Whale}:\tab Balaenopteridae, Balaenidae, Cetotheriidae,
Eschrichtiidae, Monodontidae, Physeteridae, Kogiidae, Ziphiidae
\end{itemize}

Alternatively you may align to any particular length from the left margin with \tabto{⟨length⟩} as so:

\begin{itemize}
\item\textbf{Dolphin}:\tabto{5em} Delphinidae, Platanistidae, Iniidae, Pontoporiidae
\item\textbf{Whale}:\tabto{5em} Balaenopteridae, Balaenidae, Cetotheriidae,
Eschrichtiidae, Monodontidae, Physeteridae, Kogiidae, Ziphiidae
\end{itemize}
• Welcome to TeX.SE. Can you put a complete latex code and one screenshot, please? Jun 7 '20 at 12:14

You want to use the tabto package, as Mathematician suggested.

In order to get less space, you may define a new tab with less space:

\usepackage{tabto}
\newcommand\mytab{\tab \hspace{-5cm}}

Yes, the tab command really spaces things a lot.

For me, \indent did the trick. Using this does not require any package.

After including a paragraph under \section{}, I needed to include another paragraph, but none of the methods mentioned here were working for me to indent the second paragraph. Adding sample code here:

\section{Acknowledgment}
The authors would like to thank. . .
\indent The authors would also like to thank. . .

Discovered this from here

• You need an empty line before \indent, otherwise it would apply to the paragraph above it. Mar 3 at 6:35