4

I am an English lawyer and am trying to use LaTeX to typeset a legal opinion in traditional style. I am looking for a way to automatically number paragraphs and sub-paragraphs, i.e. something that looks like the below. This is very easy with multi-level lists in Word but I can't figure out an easy way to do it with LaTeX. Any help would be much appreciated.

Is it possible to create something that looks like the below?

Many thanks!

enter image description here

Edit I now have this working as I'd like it using the following code:


\documentclass[a4paper, oneside, 12pt]{article}
\usepackage[english]{babel}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{newpxtext,newpxmath}
\usepackage{blindtext}
\usepackage[hang]{footmisc}

% \usepackage[none]{hyphenat}

% Set enumerate to have continuous numbering and make our sublist styles
\usepackage{enumitem}
\setlist[enumerate]{
    resume,
    align=left,
    topsep=0.25cm,
    itemsep=0.25cm,
    leftmargin=1cm,
    rightmargin=0cm,
    itemindent=0cm,
    labelsep=0cm,
    labelwidth=1cm,
    labelindent=0cm,
}

\newlist{enum-alpha}{enumerate}{1}
\setlist[enum-alpha]{
    label=(\alph*),
    align=left,
    topsep=0.25cm,
    itemsep=0.25cm,
    leftmargin=1cm,
    rightmargin=0cm,
    itemindent=0cm,
    labelsep=0cm,
    labelwidth=1cm,
    labelindent=0cm,
}

\newlist{enum-roman}{enumerate}{1}
\setlist[enum-roman]{
    label=(\roman*),
    align=left,
    topsep=0.25cm,
    itemsep=0.25cm,
    leftmargin=1cm,
    rightmargin=0cm,
    itemindent=0cm,
    labelsep=0cm,
    labelwidth=1cm,
    labelindent=0cm,
}

% Disable section numbering
\setcounter{secnumdepth}{0}

% Adjust section heading formats
\usepackage{titlesec}
\titleformat{\section}{\bfseries}{}{0pt}{}
\titleformat{\subsection}{\bfseries}{}{0pt}{\hspace*{1cm}}
\titleformat{\subsubsection}{\itshape}{}{0pt}{\hspace*{2cm}}

\begin{document}

    \section{Heading}
    \begin{enumerate}
     
        \item \blindtext %\footnote{\blindtext}

        \item \blindtext

        \begin{enum-alpha}
            \item \blindtext
            
            \begin{enum-roman}
            
                \item \blindtext                 
                \item \blindtext                
            
            \end{enum-roman}
            
            \item \blindtext
        
        \end{enum-alpha}
    
    \end{enumerate}

    \section{Heading}
    \subsection{Sub-heading}
    \subsubsection{Sub-sub heading}
    \begin{enumerate}
        \item \blindtext

        \begin{enum-alpha}
            \item Test.\footnote{Test}
            
            \item \blindtext             
        \end{enum-alpha}
    
    \end{enumerate}
    
    \subsection{Sub-heading}
    \begin{enumerate}
            \item \blindtext 
        \end{enumerate}

\end{document}

Which renders as attached (just screenshotting the first two pages):

enter image description here

The need to \begin and \end each enumerate environment is quite cumbersome. I was wondering if there is a way to prepare a document like this in Markdown and then use pandoc to convert it to PDF via LaTEX in a way that formats the nested lists as in my example. I suspect it will be easier to set the list definitions based on how far nested they are, rather than using named sublists, e.g:


\usepackage{enumitem}
\setlist[enumerate]{
    align=left,
    leftmargin=1cm,
    itemindent=0cm,
    labelsep=0cm,
    labelwidth=1cm,
    labelindent=0cm,
}

\setlist[enumerate,1]{
    resume,
    label=\arabic*.,
}

\setlist[enumerate,2]{
    label=(\alph*),
}

\setlist[enumerate,3]{
    label=(\roman*),
}

Does anyone know if this is possible? I've found some discussion [here] (https://docs.google.com/document/d/e/2PACX-1vSX5opye0KWQ687nLhYKW1VTs2DljUUl5fra4kicNK7ygj-_Qyc3lhuEQh3g94Z4mM7EKQLPPpa3L3Q/pub) but it seems very complicated. I am wondering whether a preamble to the Markdown file or a change to the pandoc LaTeX template might achieve the same result.

3
  • 1
    Welcome to tex.sx. I'm pretty sure that this has been asked before, but I haven't found it. The enumerate and enumitem packages have facilities to customize complicated lists, so you might look at their documentation. Dec 23, 2022 at 21:06
  • Thank you. I will take a look.
    – Seagoon
    Dec 23, 2022 at 21:14
  • I’ve edited the question above in case anyone is able to help with a slightly different query!
    – Seagoon
    Dec 24, 2022 at 17:30

2 Answers 2

2

I think the enumerate environment is what you are looking for. The option resume is from the enumitem package and allows to resume the numbering from the previous enumerate environment.

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{
    align=left,
    labelindent=0pt,
    leftmargin=1cm,
    labelsep=*,
}
\setlist[enumerate,3]{
    label=(\roman*)
}
\begin{document}
\section*{Heading}
\begin{enumerate}
    \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
    \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
    \begin{enumerate}
        \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
        \begin{enumerate}
            \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
            \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
        \end{enumerate}
        \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
    \end{enumerate}
\end{enumerate}

\section*{Heading}
\subsection*{Sub-heading}
\begin{enumerate}[resume]
    \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
    \begin{enumerate}
        \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
        \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
    \end{enumerate}
\end{enumerate}

\subsection*{Sub-heading}
\begin{enumerate}[resume]
    \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vestibulum, ante a imperdiet placerat, diam libero blandit leo, quis ullamcorper.
\end{enumerate}
\end{document}
4
  • Thank you. Isn't the enumerate environment meant to be used for lists and bullets rather than paragraphs of text?
    – Seagoon
    Dec 23, 2022 at 20:56
  • 2
    @Seagoon numbered, and especially indented, paragraphs are lists to latex. Dec 23, 2022 at 20:59
  • Thank you. I've seen elsewhere suggestions to use \everypar or to define a new counter, e.g. here Also, do you know how to change the indentation and labels in your example to match mine? In other words, change the i. to i), and change the indentation so there is no white space before the label and it is in line with the indent of the paragraph above.
    – Seagoon
    Dec 23, 2022 at 21:03
  • 1
    @Seagoon Sure! Just customize enumerate with enumitem's commands. I modified my answer accordingly. In the example, I set the left margin to 1cm, but you could use any other length if you prefer.
    – Vincent
    Dec 23, 2022 at 21:46
2

A very diferent way using linguex: Just type \ex. to make a main item, \a. to start nested list, and \b. to add more items to the nested list. To close the nested list use \z. and to close the main item and any nested sublist, just add a blank line (=\par), so yoy should avoid it betwwen subtitems in the source text. The example does not show any blank lines but \par to highlight where it should be (and where it should not be).


mwe


\documentclass{article}
\usepackage{linguex,lipsum}
\usepackage{lipsum} % just to avoid type dummy text
\renewcommand{\ExLBr}{} 
\renewcommand{\ExRBr}{.}
\renewcommand{\SubExLBr}{(} 
\renewcommand{\SubExRBr}{)}
\begin{document}
\section*{Heading}
\ex. \lipsum[1][1-2]\par
\ex. \lipsum[2][1-2]
  \a.  \lipsum[3][1-2] 
    \a.  \lipsum[4][1-2] 
    \b.  \lipsum[5][1-2]\z.
  \b.  \lipsum[6][1-2]\par
\ex. \lipsum[6][1-2]\par 
\section*{Heading}
\subsection*{Sub-heading}
\ex. \lipsum[7][1-2] 
\a. \lipsum[8][1-2] 
\b. \lipsum[9][1-2]\par 
\subsection*{Sub-heading}
\ex. \lipsum[10][1-2]\par 
\end{document}
2
  • 1
    Thanks, what are the advantages of this approach over enumitem?
    – Seagoon
    Dec 23, 2022 at 23:32
  • 1
    For lazy people, simplicity. Type \ex. foo \a. foo\ par is far better than type \begin{enumerate}\item foo \begin{enumerate}\item foo \end{enumerate}\end{enumerate} but may be not the right solution if you need much more than a single list scattered across the document.
    – Fran
    Dec 24, 2022 at 0:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .