Skip to content

Instantly share code, notes, and snippets.

@godbyk
Created August 19, 2011 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godbyk/1155673 to your computer and use it in GitHub Desktop.
Save godbyk/1155673 to your computer and use it in GitHub Desktop.
paralist
\documentclass{article}
\usepackage{nth}
\usepackage{paralist}
% Use \parenpointedenum *before* the \begin{inparaenum} environment
% to make the labels (X.Y.Z).
\makeatletter
\def\parenpointedenum{%
\pl@pointxxxenum
\def\labelenumi{(\theenumi)}%
\def\labelenumii{(\theenumii)}%
\def\labelenumiii{(\theenumiii)}%
\def\labelenumiv{(\theenumiv)}%
}
\makeatother
\begin{document}
\parenpointedenum\begin{inparaenum}
\item Start at nonterminal $Expression$
\item Select the $\nth{3}$ alternative
\item Output terminal \textbf{``(''}
\item Call the left-hand $Expression$ recursively
\begin{inparaenum}
\item Select the $\nth{2}$ alternative
\item Output terminal \textbf{``(''}
\item haha
\end{inparaenum}
\item huhu back to 5!
\end{inparaenum}
Goal:
(1) Start at nonterminal Expression
(2) Select the 3nd alternative
(3) Output terminal ``(''
(4) Call the left-hand Expression recursively
(4.1) Select the 2nd alternative
(4.2) Output terminal ``(''
(4.3) haha
(5) huhu back to 5!
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment