I am working on homework and problems are assigned from several sections of a book. For example, I have to solve problems 1, 7, 24 from section 1 and problems 2, 5, 9 from section 2. I do not care about section numbering so my counter would go 1 -> 7 -> 24 -> 2 -> 5 -> 9.

I have been typing all of this up via \begin{enumerate} and \setcounter which has become quite the hassle. My question is two-fold.

Should I continue using enumerate or should I do something else? (self-numbering, etc.)

Assuming yes to the above, how do I streamline the process of numbering? I tried to write something like \newcommand{foobar}[2]{\setcounter{#1}{#2}\addtocounter{#1}{-1}\item} but have had no such luck.

  • 2
    if you are using enumerate you don't need the counter settings just \item[7]... \item[24] ... – David Carlisle Jan 24 '15 at 22:40
  • @Sigur 18 seconds quicker than me, do you want to make that an answer:-) – David Carlisle Jan 24 '15 at 22:41
  • That was exactly what I was looking for. Thank you both. Either one of you can feel free to turn that into an answer. – user157227 Jan 24 '15 at 22:43
  • 1
    @Sigur seems a reasonable question with a reasonable answer. I've posted shorted ones:-) – David Carlisle Jan 24 '15 at 22:47
  • @DavidCarlisle, OK. I tried to make it longer and more exemplified. – Sigur Jan 24 '15 at 22:50

Every time you use a list with items you can replace the default item label using, for example,

\item[7]  Item contents here.
\item[24] Item contents here.

Or if you want an empty item just use \item[].

Those commands will not affect the list margins/alignments.

  • @DavidCarlisle But where's the proof now?! – cfr Jan 24 '15 at 23:41
  • @cfr, ow, so sorry. I deleted! But after some time both comments would be the same time ago. – Sigur Jan 24 '15 at 23:44
  • @cfr you don't need proof, just faith in the accuracy of my comments! – David Carlisle Jan 25 '15 at 0:00
  • @DavidCarlisle Philosophers against irrationality! – cfr Jan 25 '15 at 1:30
  • 1
    When you mouse over it it shows the exact time. – David Mulder Jan 25 '15 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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