8

I have a set of commands for producing various kinds of specific list-items, such as

\newcommand{\staritem}{\item[$\star$]} % not really, but you get the gist

All the ones I currently have can be used in the same way as \item, that is, just specify the item type at the start of the paragraph, and then write text as normal.

Now, I want to create a \bolditem command, that produces an \item and wraps the text in \textbf{...}. However, I'd like to make it available with the same syntax (so the users don't have to wrap the entire item text in braces).

Is this possible? How?

1
  • There might be more appropriate tags for this question, but I don't have enough rep to create new ones. Aug 5, 2010 at 12:36

1 Answer 1

8

Assuming I understand correctly what you want, here's one way to do it:

\documentclass{article}

\let\origitem\item
\renewcommand{\item}{\normalfont\origitem}
\newcommand{\bolditem}{\normalfont\origitem\bfseries}

\begin{document}
Before the list
\begin{enumerate}
\item First item
\bolditem Second item
\item Third item
\bolditem Fourth item
\end{enumerate}
After the list
\end{document}

That produces:

Before the list

  1. First item
  2. Second item
  3. Third item
  4. Fourth item

After the list

If you want the numbers in bold font as well, put the \bfseries before the \origitem. If you want to be able to write \bolditem[A] then that will work with the \bfseries before the \origitem without further modification (but would need a modicum of modification if you don't want the numbers in bold font).

5
  • 2
    \newcommand{\bolditem}{\item\bfseries} would be sufficient as \item already has been redefined.
    – Stefan Kottwitz
    Aug 5, 2010 at 12:58
  • @Stefan Kottwitz: Good point! Aug 5, 2010 at 13:13
  • Exactly what I was after - thanks! =) Aug 5, 2010 at 13:19
  • Is there a similar "\itseries" somewhere? Aug 5, 2010 at 16:57
  • 1
    Not quite, it is \itshape. Then you can combine them: \itshape\bfseries does what you'd want it to. Aug 5, 2010 at 17:09

You must log in to answer this question.

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