Home > enumerate > automatic enumerate numbering from a specified item number

automatic enumerate numbering from a specified item number

October 4Hits:0
Advertisement

Is there a way that I can start an enumerate numbering at, say 17, then have the succeeding item numbers automatically add 2 to the preceding one? Say, I want to typeset the answers to the odd-numbered exercises starting from 17, I want my list to show

17. answer 17 19. answer 19 21. answer 21 23. answer 23 . . . 

I know that this can be done manually but after a while, typing the item numbers manually can become bothersome.

Edit I put the list in the code environment to prevent automatic renumbering.

Answers

You can use a custom counter with the enumitem package, and increment this counter each time it is used as the label:

automatic enumerate numbering from a specified item number

Code:

\documentclass{article}

\newcounter{MyCounter}
\usepackage{enumitem}

\begin{document}
\setcounter{MyCounter}{17}% initial value
\begin{enumerate}[label={\arabic{MyCounter}\addtocounter{MyCounter}{2}}]
\item abc
\item bcd
\item xyz
\end{enumerate}
\end{document}

Tags:enumerate

Related Articles

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.397 s.