# Labels in the left margin

I would like to produce a text with labels in the left margin, like a reference list. Labels may have different lengths. One way to do this is to define a negative \parindent, as follows:

\parindent-12mm
\makebox[12mm][l]{A} text text text   text text text text text   text text text text   text text  text    texttexttexttext  \par
\makebox[12mm][l]{ABC} text text text   text text text text   text text text text   text text  text    texttexttexttext


The purpose of the box is to make the text begin at the left edge of the text column. However, in this way the left edge of the text column won’t be straight, because Tex expands or shrinks spaces evenly along the entire line, including the box. Therefore (instead of the box) I would need, after the label, a command that moves to the left edge of the text column in the same way as a tab command. Is there such a command?

This is easy with the enumitem package. Just define

\SetLabelAlign{margin}{\llap{#1~~}}


and use it like

\begin{description}[align=margin,labelsep=0pt]
\item[A] text text text
\item[ABC] text text text
\end{description}


MWE

\documentclass{article}
\usepackage{enumitem}
\SetLabelAlign{margin}{\llap{#1~~}}
\usepackage{showframe} % just to show the margins
\begin{document}

\begin{description}[align=margin,labelsep=0pt]
\item[A] text text text
\item[ABC] text text text
\end{description}

\end{document}


Output

Another solution is to define

\SetLabelAlign{margin}{\llap{\makebox[12mm][l]{#1}}}


In this way the result will be

Something like this: (???)

The showframe package is just for to show the position of the margins. It can be removed.

\documentclass{article}
\usepackage{showframe}

\begin{document}
\setlength{leftmargini}{0pt}
\begin{itemize}

\item[A] text text text
\item[ABC] text text text
\end{itemize}
\end{document}


• This is useful; thanks! But I don't understand how the command \SetLabelAlign works. Moreover, with the description environment the text paragraph gets a negative indentation; I don't understand why. But with enumerate the left edge of the text is straight, as I want. – Jan Boman Jan 19 '15 at 15:47

enumitem already provides a right alignment for labels. Use it with leftmargin=\labelsep

\documentclass{article}
\usepackage{enumitem}
\usepackage{showframe} % just to show the margins
\begin{document}

\begin{description}[align=right,leftmargin=\labelsep]
\item[A] text text text
\item[ABC] text text text
\end{description}

\end{document}