GeneralNumbering items

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Sekantombi
Posts: 21
Joined: Mon Apr 21, 2008 3:50 am

Numbering items

Post by Sekantombi »

Dear Colleagues,

I want to produce automatic numbering for items, but preceded with a consistent string.

So far my research on numbering has pulled out things about LaTex counters --- applied to headings, sections et cetera, but not quite the "automatic numbering of things that follow a string" that I have in mind.

Partial success hacking the numberpars package, but this entails some formatting constraints.

Similar results with enumerate ... unless there's some way to prefix "\item" with a string?

Don't want to have to number these things by hand --- time-consuming and too much opportunity for error.

Any advice?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Numbering items

Post by gmedina »

The enumitem package could be useful. Juanjo showed another approach in this thread.

A little example using enumitem:

Code: Select all

\documentclass{article}
\usepackage{enumitem}

\begin{document}

text text text text text
\begin{enumerate}[label=string--\arabic*,leftmargin=*]
  \item First item
  \item Second item
\end{enumerate}
text text text text text

\end{document}
Perhaps describing exactly what you desire to achieve, we could give you more effective help.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Sekantombi
Posts: 21
Joined: Mon Apr 21, 2008 3:50 am

Numbering items

Post by Sekantombi »

Thanks for your answer, gmedina, especially your last piece of advice!

What I have in mind is a list of recommendations.

So I am already applying \newcommand to items under enumerate …

In addition …

My objective is to do "Recommendation (number)", where number is set and incremented automatically.

So this is a little different from re\defining enumi et cetera.

Any further advice?

Cheers,
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Numbering items

Post by gmedina »

Sekantombi wrote:...What I have in mind is a list of recommendations...My objective is to do "Recommendation (number)", where number is set and incremented automatically...
My first suggestion then is still valid.

Code: Select all

\documentclass{article}
\usepackage{enumitem}

\begin{document}

text text text text text
\begin{enumerate}[label=\textbf{Recommendation \arabic*}.,leftmargin=*]
  \item First recommendation with some text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
  \item Second recommendation.
\end{enumerate}
text text text text text

\end{document}
Refer to the enumitem package documentation to see all the options it offers.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Sekantombi
Posts: 21
Joined: Mon Apr 21, 2008 3:50 am

Re: Numbering items

Post by Sekantombi »

Thanks Gmedina ---

That makes perfect sense.

Apologies for not reading your post with a little more diligence.
Post Reply