Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

enter image description here

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

share|improve this question
    
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 3

up vote 5 down vote accepted

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} 

enter image description here

share|improve this answer

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

enter image description here

\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.

share|improve this answer

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

enter image description here

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.