[Tex/LaTex] automatic enumerate numbering from a specified item number

#enumerate

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.

Best Answer

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

enter image description here

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}
Related Question