Counters in lists etc.

When using enumerated lists, you can change the value of the counter to something else, for example, if you have a list that’s broken up by text, or some such. To do this, use the addcounter command:

begin{enumerate}
addtocounter{enumi}{9}
item blah blah
item wibble wibble
end{enumerate}

The style of the counter can be changed as well, for example, to use Roman numerals, Arabic numbers and so on. This can be done in enumerate environments by changing the enumi, enumii etc. counters:

renewcommand{labelenumi}{II–alph{enumi}}
begin{enumerate}
item first item in list
item second item in list
item third item in list
item fourth item in list
end{enumerate}

This will produce a counter II–a, II–b etc.. You may need to remember to put the counter back as it was if this is only a temporary change.

renewcommand{labelenumi}{arabic{enumi}}

The same effect can be achieved in the list environment without changing the built-in counters by setting up a new counter as follows:

newcounter{newC}
begin{list}{II–alph{newC}}
{usecounter{newC}}
item first item in list
item second item in list
item third item in list
item fourth item in list
end{list}

Note the curly brackets around the usecounter command. Settings such as margin width for indentation purposes may be set inside the curly brackets following the usecounter command. Also note that references to labelled items will not work as expected here.

See also Help on LaTeX Counters for more information.


Will you be the first person to respond?

Leave a Reply

or use a social network to log in