1

I want to bold a single number in the bulleted list to identity the problems my students need to turn in for homework.

I am using the enumitem package and this is what I am talking about.

Instructions for the questions:
1. Questions 1
2. Questions 2
3. Questions 3

Some more questions...

Any help will be greatly appreciated.

1

Try this new command version.

\documentclass{article}
\usepackage{enumitem}
\newcommand{\itembf}{\item[\stepcounter{enumi}\textbf{\arabic{enumi}.}]}
\begin{document}
\begin{enumerate}
\item Question 1
\itembf Question 2
\item Question 3
\itembf Question 4
\item Question 5
\itembf Question 6

\end{enumerate}
\end{document}
  • Why not \refstepcounter? – Werner Sep 17 '15 at 13:06
  • Quoting from the LaTeX2e reference manual (via TeXStudio help): "The \refstepcounter command works in the same way as \stepcounter See \stepcounter, except it also defines the current \ref value to be the result of \thecounter. " Would using \refstepcounter improve anything? I'm not sure. – Bill N Sep 17 '15 at 14:33
  • Try using \label for \itembf and then \ref. See what you get... – Werner Sep 17 '15 at 15:09
  • Bill N, Thanks for the answer. Your solution works if it is the first level of the list and is a list in arabic form. So, I can modify it for different levels with enumii, enumiii, etc. and using different list types: roman, alpha, etc. It will work, so thanks for the solution!!!!!! – Ashish Sep 17 '15 at 16:51
  • Bill N., a quick follow up. I am also using the inline list from the enumitem package, so how would I bold a single number in an inline list? Thanks! – Ashish Sep 18 '15 at 13:27
0

The following works with/without enumitem, but only pertains to the first level of enumeration:

enter image description here

\documentclass{article}

%\usepackage{enumitem}
\makeatletter
\newcommand{\bolditem}{{%
  \renewcommand\labelenumi{\bfseries\arabic{enumi}.}% Update label to bold
  \item\leavevmode% Set item
  \xdef\@currentlabel{\@currentlabel}% Preserve label (for cross-reference purposes)
}}
\makeatother

\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}

\bolditem temporarily redefines the way the enumeration label is printed, then sets a regular \item and reverts back to the default definition.

  • \bolditem \label{x} Second item and \bolditem \label{x}Second item will produce different results – egreg Sep 17 '15 at 8:38

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.