2

I'm trying to generate a numbered list of names using the register system of genealogical numbering. It should look something like the following:

1    (i)  John Smith.  Lorem ipsum dolor sit amet, consectetur 
          adipiscing elit, sed do eiusmod tempor incididunt ut 
          labore et dolore magna aliqua. ...
    (ii)  Ann Smith.
   (iii)  James Smith.
2   (iv)  Eliza Smith.

... with the two types of numerals aligned (right aligned for the Roman ones, left for the Arabic). I can do this with a tabular \begin{tabular}{lrp{\somewidth}}, but then I have to work out the correct column widths, which is a nuisance; I can't get round this by using the X specifier from the tabularx package because very often I'll want to span pages, and the workarounds for that are all a bit tedious. In any case, it feels like the right place for an enumerate-like environment

My current best idea is to automate the numbering in something like this:

\documentclass{article}
\usepackage{lipsum} % for dummy text only
\begin{document}
\begin{enumerate}
\item[1\quad(i)] John Smith. \lipsum[1]
\item[(ii)] Ann Smith.
\item[(iii)] James Smith.
\item[2\quad(iv)] James Smith.
\end{enumerate}
\end{document}

But then I don't get alignment of the Arabic numbers. Any ideas?

  • I just updated my answer with some other settings taking care of the case in which the "outer" list counter has more than one digit. – Gonzalo Medina Oct 15 '15 at 23:01
5

Here's one option using the enumitem package:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}

\newlist{menumerate}{enumerate}{2}
\setlist[menumerate,1]{label=\arabic*}
\setlist[menumerate,2]{label=(\roman*)}

\begin{document}
\begin{menumerate}
\item\begin{menumerate}
\item John Smith. \lipsum[1]
\item Ann Smith.
\item James Smith.
\end{menumerate}
\item
\begin{menumerate}[resume]
\item James Smith.
\end{menumerate}
\end{menumerate}
\end{document}

enter image description here

If you need to increase the spacing between the Arabic and Roman numerals, you can use something like

\newlist{menumerate}{enumerate}{2}
\setlist[menumerate,1]{label=\arabic*,wide,leftmargin=*,labelsep=20pt}
\setlist[menumerate,2]{label=(\roman*),labelsep=5pt}

A complete example:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}

\newlist{menumerate}{enumerate}{2}
\setlist[menumerate,1]{label=\arabic*,wide,leftmargin=*,labelsep=20pt}
\setlist[menumerate,2]{label=(\roman*),labelsep=5pt}

\begin{document}
\begin{menumerate}
\item\begin{menumerate}
\item John Smith. \lipsum[1]
\item Ann Smith.
\item James Smith.
\end{menumerate}
\item
\begin{menumerate}[resume,start=99]% start value just for the example
\item James Smith.
\end{menumerate}
\end{menumerate}
\end{document}

enter image description here

If the inner list is always supposed to continue the numbering the resume option can be included in the \setlist:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}

\newlist{menumerate}{enumerate}{2}
\setlist[menumerate,1]{label=\arabic*,wide,leftmargin=*,labelsep=20pt}
\setlist[menumerate,2]{label=(\roman*),labelsep=5pt,resume}

\begin{document}
\begin{menumerate}
\item
  \begin{menumerate} 
  \item John Smith. \lipsum[1]
  \item Ann Smith.
  \item James Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item James Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\end{menumerate}

\end{document}

enter image description here

And perhaps, even better, something like this:

\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}

\newlist{menumerate}{enumerate}{2}
\setlist[menumerate,1]{
  label=\arabic*,
  leftmargin=50pt,
  labelsep=15pt,
  labelwidth=20pt,
  align=left
}
\setlist[menumerate,2]{label=(\roman*),labelsep=5pt,resume}

\begin{document}

\begin{menumerate}
\item
  \begin{menumerate} 
  \item John Smith. \lipsum[1]
  \item Ann Smith.
  \item James Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item James Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\item
  \begin{menumerate}
  \item Henry Smith.
  \end{menumerate}
\end{menumerate}

\end{document}
  • Two problems with this. First, it doesn't seem possible to not put an Arabic number on the first entry. The Arabic numbers are simply cross-references to later sections, so it's quite common for the first name not to have one. Second and more cosmetically, because it uses a nested enumeration, it's hard to stop there from being extra spacing before an Arabic-numbered line. (This can be fixed with careful setting of the spacings.) – richard Oct 17 '15 at 0:34
  • @richard For the first "issue", you can use an empty optional argument for \item, as in \begin{menumerate} \item[] \begin{menumerate} \item John Smith. \lipsum[1] \end{menumerate} \item \begin{menumerate} \item James Smith. \end{menumerate} \end{menumerate} – Gonzalo Medina Oct 17 '15 at 3:25
  • @richard For the second one, if I understood correctly, you can use nosep as in \setlist[menumerate,1]{ label=\arabic*, leftmargin=50pt, labelsep=15pt, labelwidth=20pt, align=left, nosep } \setlist[menumerate,2]{label=(\roman*),labelsep=5pt,resume} – Gonzalo Medina Oct 17 '15 at 3:27
4

Something like this? I define a new environment geneology. Within this environment, \nextgene is used to indicate that the outer counter should increment. Otherwise, just use \item as usual.

\documentclass{article}
\usepackage{lipsum,enumitem}
\newlist{geneo}{enumerate}{1}
\newlist{geneol}{enumerate}{1}
\setlist[geneo,1]{label=\arabic*, align=left}
\setlist[geneol,1]{label=(\roman*)}
\newenvironment{geneology}{%
  \begin{geneo}\item\begin{geneol}%
}{%
  \end{geneol}\end{geneo}%
}
\newcommand*\nextgene{%
  \end{geneol}\item\begin{geneol}[resume]%
}

\begin{document}
\begin{geneology}
  \item John Smith. \lipsum[1]
  \item Ann Smith.
  \item James Smith.
  \nextgene
  \item James Smith.
\end{geneology}
\end{document}

geneology

0

The solutions from @Gonzalo Medina and @cfr are ingenious, but I can't help but feel the nested enumeration is wrong. Logically it's a single list, not a list of lists. I've spent the morning looking for a better solution and think I have one: use the more primitive list environment instead of enumerate.

\documentclass{article}
\usepackage{etoolbox}
\usepackage{lipsum}  % For dummy text only
\newcounter{childcounter}
\newenvironment{children}{
  \begin{list}{\childxref\hfill(\roman{childcounter})\quad}{
    \usecounter{childcounter}\setlength\labelsep{0em}
    \setlength\labelwidth{5em}\setlength\leftmargin{5em}
    \newcommand{\child}[1][]{\def\childxref{##1}\item}}
}{\end{list}}
\begin{document}
\begin{children}
\child[1] John Smith. \lipsum[1]
\child Ann Smith.
\child James Smith.
\child[2] James Smith.
\end{children}
\end{document}

The normal use I anticipate for the optional argument to \child would be something like \child[\ref{james}], so I'd probably define it to take the label name directly:

\newcommand{\child}[1][]{%
  \def\childxref{\ifstrempty{##1}{}{\ref{##1}}}\item}}

which also requires \usepackage{etoolbox} to define \ifstrempty. Then I can just write \child[james] provided that elsewhere I have a \label{james}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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