0

I'm attempting to create a rulebook which is structured as follows:

Chapter 1

Rule 1 - Rule name

Rule 2 - Rule name

Chapter 2

Rule 3 - Rule name

It is important for this rule book that I can add new rules and chapters in between other rules/chapters at a later date or just re-order them. Currently I am using just a regular text editor (like Word/Google Docs). This means that every time I do add something new or re-order, I manually have to adjust all the numbers. Additionally, if there are references to one of the chapters/articles I also have to adjust those. This is a lot of work.

I am wondering if using LaTeX would resolve some of these issues, but I'm not an expert so I'm hoping some of you could help me with this. Is it possible to:

  • Have an automatic enumeration as I've shown above. That would be an enumeration where the number is not the first thing (i.e. there is always the word "Rule" before the number) and where the enumeration continues through chapters (i.e. it does not reset).
  • Be able to reference these rules/chapters in a similar way as you would normally use \label and \ref. These references would then also automatically adjust when something gets added/changed.

Thanks a lot for your help in advance!

6
  • 1
    This can be done using enumitem and its resume/resume* keys.
    – daleif
    Commented Feb 28, 2022 at 15:38
  • Would you be able to provide an example?
    – Astarno
    Commented Feb 28, 2022 at 15:43
  • \begin{enumerate}[label=Rule \arabic*] to start the first list, \begin{enumerate}[resume*] on the others. It is listes in the enumitem manual.
    – daleif
    Commented Feb 28, 2022 at 15:45
  • Alright, that solves one of the issues. Does it also allow me to not have the number at the start of each item? (e.g. "Rule 1" instead of "1. Rule") and does it allow me to reference these items?
    – Astarno
    Commented Feb 28, 2022 at 15:56
  • Not understood. \item will generate Rule 1, Rule 2 etc. Items under enumerate are referable, they even retain the item formatting (configurable). Have a play with enumitem to see for yourself
    – daleif
    Commented Feb 28, 2022 at 16:10

3 Answers 3

1

My impression is that you want section titles. For clarity of input, I provide a \Rule command that's nothing else than \section.

The oneside option is just to make a self-contained picture

\documentclass[a4paper,oneside]{book}
\usepackage{titlesec}

\titleformat{\section}[block]
  {\large\bfseries}
  {Rule \thesection\ --- }
  {0pt}
  {}

\newcommand{\Rule}{\section}
\newcommand{\Ruleref}[1]{Rule~\ref{#1}}
\counterwithout{section}{chapter}

\begin{document}

\chapter{Basic rules}

\Rule{Very basic rule}\label{rule:basic}

This is the first and basic rule.

\Rule{Less basic rule}

This is a less basic rule.

\chapter{Advanced rules}

\Rule{Difficult rule}

This is a difficult rule.

\Rule{Awkward rule}

Following this rule is unintuitive, see~\Ruleref{rule:basic}
for confirmation.

\end{document}

enter image description here

0

Here is how to do it explicitly with enumitem, defining a new list:

\documentclass{report}
\usepackage{enumitem}
\newlist{rules}{enumerate}{1}
\setlist[rules,1]{wide = 0pt, label=Rule \arabic* – , font=\sffamily, leftmargin=*}
\usepackage{lipsum}

\begin{document}

\chapter{Foo}
\lipsum[11]
\begin{rules}
  \item Blah blah blah!
  \item Meow!
\end{rules}

 \chapter{A chapter on chapters}
\begin{rules}[resume*]
  \item Bleh bleh bleh!
\end{rules}

\end{document} 

enter image description here enter image description here

0

There are different method to achieve this, here is an alternative using amsthm package for theorems. You can also use thmtools so you can style it the way you prefer.

\documentclass{book}
\usepackage{amsmath, amsthm, lipsum}
%\usepackage{thmtools}
\newtheoremstyle{note}% name
{3pt}% Space abovei1
{3pt}% Space belowi1
{\upshape}% Body font
{}% Indent amounti2
{\bfseries}% Theorem head font
{}% Punctuation after theorem head
{.5em}% Space after theorem headi
{}% Theorem head spec (can be left empty, meaning `normal' )
\theoremstyle{note}
\newtheorem{Rule}{Rule}
\usepackage{hyperref}
\begin{document}
\chapter{First}

\begin{Rule}[Some Test]
\lipsum[1]\label{1}
\end{Rule}

\begin{Rule}
\lipsum[3] \label{2}
\end{Rule}
\ref{1}\ref{2}
\end{document}

You must log in to answer this question.

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