# Horizontal alignment within itemize

My minimum working example:

\documentclass{article}

\begin{document}

\begin{itemize}

\item 1. First
\item 2. Second
\item 3a. Third
\item 3b. Third
\item 4. Fourth

\end{itemize}

\end{document}


The result:

How can I horizontally align the text (First, Second, Third etc)?

-
this is a hack, but ..., after 1. and the other single digit entries, insert \phantom{b}\  -- you do need that final space. –  barbara beeton Apr 11 at 18:53
Is it OK to assume that the first-level enumerate environment will never have more than nine items? –  Mico Apr 11 at 19:13

## 3 Answers

You can define a new command \myitem

\newcommand{\myitem}[1]{%
\item\makebox[1.5em][l]{#1}%
}


and use it instead of \item in these particular itemizes

MWE:

\documentclass{article}

\newcommand{\myitem}[1]{%
\item\makebox[1.5em][l]{#1}%
}

\begin{document}

\begin{itemize}

\myitem{1.} First
\myitem{2.} Second
\myitem{3a.} Third
\myitem{3b.} Third
\myitem{4.} Fourth

\end{itemize}

\end{document}


-

It seems more appropriate to use an enumerate environment for numeral enumeration. However, there are a number of ways to achieve this:

\documentclass{article}
\usepackage{calc}% http://ctan.org/pkg/calc
\begin{document}

\begin{itemize}
\item 1.\phantom{a}\ First
\item \leavevmode\rlap{2.}\phantom{3a.} Second
\item 3a.\ Third
\item 3b.\ Third
\item \makebox[\widthof{3a.}][l]{4.} Fourth
\end{itemize}

\end{document}


\rlap provides a right overlap, while a LaTeX2e approach would be to use \makebox (together with the help of calc's \widthof). There is a mild difference in the alignment around 3a. and 3b.. So, depending on your level of detail, you may want to use some of the other overlapping techniques in the sub-enumeration as well.

The use of \  is so that the period . doesn't produce a sentence-ending space.

The adjustbox package can provide similar "lapping" support.

-

I would recommend using an automated approach using an enumerate environment to add the numbering:

## Code:

\documentclass{article}
\usepackage{enumitem}

\newcommand*{\MakeBox}[1]{\makebox[1.5em][r]{#1}}%

\begin{document}

\begin{enumerate}[label={\textbullet\protect\MakeBox{\theenumi.}}]

\item First
\item Second
\begin{enumerate}[label={\textbullet\protect\MakeBox{\arabic{enumi}\alph*.}}, align=right, before={\stepcounter{enumi}}, leftmargin=0pt]
\item Third
\item Third
\end{enumerate}
\item Fourth

\end{enumerate}

\end{document}

-