6

I use the following code to obtain a listed item

\documentclass{article}
\usepackage{paralist}

\begin{document}
\begin{inparaenum}[(a)]
\item first item,
\item second item,
\item last item
\end{inparaenum}
\end{document}

I would like to have the counters, in this case: (a), (b), (c) to be formatted in bold (\bfseries). However, only the counter itself and not the surrounding parentheses should be in bold.

obviously the following doesnt work:

\begin{inparenum}[\bfseries{(a)}]

So can I achieve what I want without hardcoding the package?

Thorsten
  • 12,872
Timtico
  • 2,250
  • 2
    The reason this doesn't work is that \bfseries is not a macro that takes an argument; (that command is \textbf{}) it's a switch that "turns on" boldface. Your posted answer also doesn't work, but lockstep's does for this reason: you need to turn boldface on inside the paretheses and then turn it off again, which is exactly what his solution does. – Alan Munn May 24 '11 at 15:59
  • 1
    And you should accept egreg's answer, instead of lockstep's for the reasons stated... (This is one reason why it's a good idea to wait some time before accepting an answer.) – Alan Munn May 24 '11 at 16:11

3 Answers3

11

The "right" answer is

\begin{inparaenum}[(\bgroup\bfseries a\egroup)]

Calling \normalfont after a is not really a solution, as this might give a closing parenthesis different from the opening one (if the current font is slanted, for example).

egreg
  • 1,121,712
  • @WillRobertson and @JosephWright concluded in http://tex.stackexchange.com/a/1932/16940 that \begingroup is usually preferable to \bgroup, but that there are situations where the latter has to be used. Does it make a difference here or is it just a matter of taste? – anonymous Aug 31 '12 at 11:25
  • @anonymous In this case it doesn't make any difference; what's important is not using {...} that would defeat the search for the a that states how to number the items. – egreg Aug 31 '12 at 13:02
  • Ah, now I got it: \**b**group stands for begin-group and \**e**group for end-group! Why didn't I realise before... – Nikos Alexandris Jan 03 '13 at 11:09
2
\documentclass{article}
\usepackage{paralist}

\begin{document}
\begin{inparaenum}[(\bfseries a\normalfont)]
\item first item,
\item second item,
\item last item
\end{inparaenum}
\end{document}
lockstep
  • 250,273
0

Interestingly, the following achieves exactly what i wanted:

\documentclass{article}
\usepackage{paralist}

\begin{document}
\begin{inparaenum}[\bfseries{} (a)]
\item first item,
\item second item,
\item last item
\end{inparaenum}
\end{document}
Timtico
  • 2,250