Welcome to the TeXnik website (under construction) Labels for Lists |
||||||||||||
|
Label Width |
Multiline labels |
Style |
LabelWith packageenumitem 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-StyleChanging the enumerationstyle to1. ... 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. ... Bthen 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 labelsThe description environment may have multiple lines for the label. |