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.

Advertisements
Leave a comment

What do you have to say about this?

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: