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.

I would like to be able to replicate the following image. I am not sure how to force the enumerate to align after $M_2 =$. Could anyone provide an example replicating this?enter image description here

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

One option using enumitem:

\documentclass{article}
\usepackage{enumitem}

\newlength\Separation
\begin{document}

\noindent
$M_2={}$ ``On input string
\settowidth\Separation{$M_2={}$ }
\begin{enumerate}[
  nolistsep,
  label=\textbf{\arabic*.},
  leftmargin=\dimexpr\labelwidth-\labelsep+\Separation\relax
]
\item First.
\item Third.
\item Second.''
\end{enumerate}

\end{document}

enter image description here

The calculation for the horizontal distance for the labels is made with \labelwidth-\labelsep+\Separation, where \Separation is the width of the string you need as alignment point; $M_2={}$, in this case.

share|improve this answer
add comment

This can be done with a tabular:

\documentclass{article}
\usepackage{array,enumitem}
\newcolumntype{L}{>{\raggedright\arraybackslash}p{\dimexpr0.9\textwidth-2\tabcolsep\relax}}
\begin{document}
  \noindent
  \begin{tabular}{>{\centering\arraybackslash}p{0.1\textwidth}@{}L}
  $M_{2} ={}$ & ``On input string $w$:
                \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0pt,before=\vspace{-0.5\baselineskip},parsep=0pt]
                \item Sweep left to right
                \item If in stage 1, 
                \item If in stage 1, the tape contained more than single 0 and the number of 0s was odd \emph{reject}''
                \end{enumerate}
  \end{tabular}
\end{document}

enter image description here

share|improve this answer
add comment

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.