1

I need to achieve similar effect like in this question: enumerate custom label

However I would rather use description list with enumerated labels. Like I would write:

\begin{description}
  \item[UR-1] blah blah
  \item[UR-2] foo bar
\end{description}

but without manual labels counting.

0

2 Answers 2

3

You could just define your own counter:

% arara: pdflatex    

\documentclass{article}
\newcounter{mycounter}
\newcommand*{\mycount}{\stepcounter{mycounter}\themycounter}

\begin{document}
\begin{description} 
    \item[UR-\mycount] blah blah
    \item[UR-\mycount] foo bar
    \setcounter{mycounter}{0} % if you want to use it again.
\end{description}
\end{document}

enter image description here

Of course you may add the "UR-" or anything else to the command \mycount. And you may define automatic labelling with help of the package enumitem. Bit it is not clear from your question, what you are achieving to do and why you want to have it as a description.

4
  • Thanks for fast and correct answer. I need it to list a lot of UR-x items and define them.
    – WojciechKo
    Jan 21, 2015 at 14:13
  • What does \themycounter do?
    – WojciechKo
    Feb 2, 2015 at 23:43
  • 1
    @WojciechKo It prints out the current number of your counter mycounter
    – LaRiFaRi
    Feb 5, 2015 at 22:35
  • @LaRIFaRI : How do you set bold for UR-item fields?
    – pzorba75
    Oct 16, 2019 at 2:55
2

You can do that quite easily with the enumitem package and an enumerate environment:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\setlength{\parindent}{0cm}

\usepackage[shortlabels]{enumitem}

\usepackage{lipsum}

\begin{document}

\lipsum[11]
\begin{enumerate}[label=UR-\arabic*., font=\bfseries, wide= 0pt, leftmargin=2em]
\item Some text, some text, , some text, some text, , some text, some text, some text, some text, some text.
\item Some more text, some more text, some more text, some more text, some more text, some more text, some more text, some more text, some more text, some more text.
\end{enumerate}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .