[Tex/LaTex] Tabbing from the beginning of a line

tabbing

I want to tab a list of items like in Microsoft Word, where the tab command always tabs by a fixed number of spaces from the beginning of the line.

Here's a sample of what I'm looking for:

Kav       average kinetic energy
N         number of atoms
gamma     a Greek letter

What command might I use to obtain the above output?

Best Answer

Environment tabbing

LaTeX also knows a tabbing environment:

\= sets a tabulator, which can be again reached by \>. \kill cancels the line, but keeps the tabulator settings.

\documentclass{article}
\begin{document}
  \begin{tabbing}
    gamma\quad\= a Greek letter\kill
    Kav       \> average kinetic energy\\
    N         \> number of atoms\\
    gamma     \> a Greek letter
  \end{tabbing}
\end{document}

Result tabbing

Environment tabular

A tabular can be used:

\documentclass{article}
\begin{document}
  \begin{tabular}{@{}ll@{}}
    Kav   & average kinetic energy\\
    N     & number of atoms\\
    gamma & a Greek letter\\
  \end{tabular}
\end{document}

Result tabular

Environment description

Such a list can also be set as description list, e.g.:

\documentclass{article}
\usepackage{enumitem}
\usepackage{calc}
\begin{document}
  \begin{description}[labelwidth=\widthof{\bfseries gamma}]
    \item[Kav]   average kinetic energy
    \item[N]     number of atoms
    \item[gamma] a Greek letter
  \end{description}
\end{document}

Result description

Related Question