Text FormattingCustomising enumerate/itemize environment, section numbering

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
harroldc
Posts: 7
Joined: Mon Aug 16, 2010 2:51 pm

Customising enumerate/itemize environment, section numbering

Post by harroldc »

Hello, can you please advise me on how can I customise either enumerate or itemize environment to change the indentation of text after letters? I am trying to achieve this document design for work purposes and the only problem are bigger spaces after letters, as you can see on the second page: http://www.opsi.gov.uk/acts/acts2010/pd ... 014_en.pdf

By default, the spaces are smaller and none of the solutions I have found work, as they for example affect only the first line, not the whole paragraph.

As to my second question, I would like to know how can I change the section numbering. For example, I want the sub-subsection "0.0.1 Text" to be shown as "1 Text", possibly with a customised space as you can see in the same hyperlinked document, so the final look would be "1 (variable space) Text".

Thank you very much in advance for you effort.
Last edited by harroldc on Mon Aug 16, 2010 5:50 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Customising enumerate/itemize environment, section numbering

Post by meho_r »

You may customize sectioning units appearance using titlesec package, and lists using enumitem package. Here's a quick example:

Code: Select all

\documentclass{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{mathpazo}

\usepackage{enumitem}
\setenumerate{leftmargin=3.2em,labelsep=1em}
\setenumerate[1]{label=(\arabic*)}
\setenumerate[2]{label=(\alph*),topsep=0pt}
\setenumerate[3]{label=(\roman*),topsep=0pt}

\usepackage{titlesec}
\titleformat{\subsection}{\bfseries}{\bfseries\thesubsection}{2em}{}
\renewcommand{\thesubsection}{\arabic{subsection}}

\begin{document}

\subsection{Anti-Slavery Day}

\begin{enumerate}
\item The Secretary of State shall by order made by statutory instrument specify a date which shall be observed each year as Anti-Slavery Day.
\item The purpose of Anti-Slavery Day shall be to—

   \begin{enumerate}
      \item acknowledge that millions of men, women and children continue to be victims of slavery, depriving them of basic human dignity and freedom;
      \item raise awareness amongst young people and others of the dangers and consequences of slavery, human trafficking and exploitation and encourage them to be proactive in the fight against it;
      \item draw attention to—

      \begin{enumerate}
         \item the progress made by government and those working to combat all forms of slavery, human trafficking and exploitation, and                
         \item what more needs to be done.
      \end{enumerate}

   \end{enumerate}

\item In this Act “slavery” includes—

   \begin{enumerate}
      \item trafficking for sexual exploitation,
      \item child trafficking,
      \item trafficking for forced labour, and
      \item domestic servitude.
   \end{enumerate}

\end{enumerate}

\end{document}

You may play with numbers and instead of em use any other unit (pt, mm, cm...). You may do further customization following instructions in manuals of above-mentioned packages.
harroldc
Posts: 7
Joined: Mon Aug 16, 2010 2:51 pm

Re: Customising enumerate/itemize environment, section numbe

Post by harroldc »

Excellent! Thank you very much!

Joining this forum has proven very useful.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Customising enumerate/itemize environment, section numbering

Post by meho_r »

I'm glad it helped. And welcome to our community :)

P.S. Now that the problem is solved, please follow Board Rules, section 3, and mark the thread as solved.
harroldc
Posts: 7
Joined: Mon Aug 16, 2010 2:51 pm

Re: Customising enumerate/itemize environment, section numbe

Post by harroldc »

Done. And thank you for giving me notice of the rule as well. Somehow, I overlooked it.

EDIT: Oh, one more expression of how great was your help – although I did not ask, I was wondering which font they used and you answered it. Splendid. :)
Post Reply