7

I have the following list:

\begin{enumerate}
    \item Particle Synthesis
    \item Video analysis
    \item Temperature Calibration
    \item Video Demonstration
\end{enumerate}

Which gives me a list enumerated by numericals (1., 2., ,...). Could someone advise me how to add an 'S' in front of each label (S1., S2., ...) ?

Tian
  • 173

2 Answers2

12

I wanted to point that, while redefining \theenumi is fine in most cases, the situation can be more complex if the counter is prefixed with a longer text, as by default the label of an enumerate environment is right-aligned at a fixed distance of the text leftmargin (\leftmargini here) and it can overflow into the leftmargin.

A better solution for this case is to use the versatile package enumitem. Demo:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{fourier}
\usepackage{enumitem}

\begin{document}

\renewcommand{\theenumi}{SSS\,\arabic{enumi}}
\begin{enumerate}
    \item Particle Synthesis
    \item Video analysis
    \item Temperature Calibration
    \item Video Demonstration
\end{enumerate}

\noindent With \texttt{enumitem}:
\begin{enumerate}[label=SSS\,\arabic*, wide=0pt, leftmargin=*]
    \item Particle Synthesis
    \item Video analysis
    \item Temperature Calibration Temperature Calibration Temperature Calibration Temperature Calibration
    \item Video Demonstration
\end{enumerate}

\end{document} 

enter image description here

marsupilam
  • 6,383
Bernard
  • 271,350
  • As your example shows, this package is great, e.g. in removing the otherwise automatic added trailing dot -- as you can see in the first part of your example. Output: SSS 1., whereas you only defined: SSS\,\arabic{enumi} (without any trailing dot!). – Jan Jun 22 '21 at 07:13
11

See How do I change the `enumerate` list format to use letters instead of the default Arabic numerals?

You can use : \renewcommand{\theenumi}{S\arabic{enumi}}

The output

enter image description here

The code

\documentclass[12pt]{article}
\usepackage{fourier}
\begin{document}
\thispagestyle{empty}
{ % create a group so the change is local 
\renewcommand{\theenumi}{S\arabic{enumi}}
\begin{enumerate}
    \item Particle Synthesis
    \item Video analysis
    \item Temperature Calibration
    \item Video Demonstration
\end{enumerate}
}
\noindent Let's see a subsequent enumerate.
\begin{enumerate}
    \item Particle Synthesis
    \item Video analysis
    \item Temperature Calibration
    \item Video Demonstration
\end{enumerate}
\end{document}
marsupilam
  • 6,383