Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Revolved or resolved? –  Host-website-on-iPage Feb 20 at 6:14
    
@AneeshKarthikC This was resolved. That is why I accepted the answer. Do you have the same problem as mine? –  hpesoj626 Feb 20 at 11:39
    
Yes. It worked for me! –  Host-website-on-iPage Feb 21 at 3:25

1 Answer 1

up vote 7 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.