[Tex/LaTex] Define command for bold list-item

bolditemizelistsmacros

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?

Best Answer

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).

Related Question