TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

Labels for Lists
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


Label Width |  Multiline labels |  Style | 


Label

With package enumitem it is very easy to get the right label width and an individual label style. If you want to have for example a label like "A1-1", where the first digit is the chapter number and the second the item number, start the enumeration list with
[...]
\usepackage{enumitem}
[...]
\begin{enumerate}[label=A\thechapter-\arabic*,calcmargin=99]
[...]

Enumeration-Style

Changing the enumerationstyle to
1. ...
   1.1. ...
   1.2. ...
2.
write in latex preamble or anywhere in the text:
\renewcommand\labelenumi{\arabic{enumi}.}
\renewcommand\labelenumii{\arabic{enumi}.\arabic{enumii}.}

If you want the same with

A ...
   A-C. ...
   A-B. ...
B
then write in preambel or text
\renewcommand\labelenumi{\Alph{enumi}}
\renewcommand\labelenumii{\Alph{enumi}-\Alph{enumii}}

The following example defines a label like C1. and refers to this labels without the dot.
\documentclass{article}
\begin{document}
\begin{enumerate}
    \renewcommand{\labelenumi}{C\arabic{enumi}.}
    \renewcommand{\theenumi}{C\arabic{enumi}}
    \item First \label{One}
    \item Second \label{Two}
\end{enumerate}
The nice label \ref{One} and \ref{Two} ...
\end{document}

Multiline labels

The description environment may have multiple lines for the label.

local time: Wed Oct 16 21:43:57 CEST 2019 ; file is: 110.310694444444 days old
contact webmaster _at_ TeXnik.de