2

The problem is as follows: I need to set an inline list with colored lowercase letters surrounded by black brackets. This is not so hard to achieve, but the problem is that kerning is lost in the process.

If I add two colorization commands: one before the letter and one before the right bracket, then the second command (which restores black color) messes the kerning. Same happens with paralist and enumitem 3 alpha (take a look at "f"; with other fonts the letter and the bracket actually overlap):

\documentclass{book}

\usepackage{paralist}
\usepackage{xcolor}

\setdefaultenum{(a)}{(i)}{A.}{A.}

\begin{document}

\begin{inparaenum}
\item first,
\item second,
\item third,
\item fourth,
\item fifth
\item sixth
\end{inparaenum}

\begin{inparaenum}[(\color{red}a\color{black})]
\item first,
\item second,
\item third,
\item fourth,
\item fifth
\item sixth
\end{inparaenum}

\end{document}

Suggestions?

1 Answer 1

3

Color changes put something that inhibits automatic kerning, just like using two different fonts. You can add manually the italic correction (which does something also with upright fonts, if they are well designed)

\begin{inparaenum}[(\textcolor{red}\bgroup a\/\egroup)]

which is also better than reverting to black explicitly.

3
  • Your code is equivalent to \textcolor{red}{\bgroup} a\/\egroup and will expand to \protect \leavevmode {\color {red}\bgroup}a\/\egroup which actually works as expected. I this on purpose? Because a simple {\color{red} a\/} (or maybe {\color{red} a}\/) would do the same. Commented May 20, 2011 at 14:18
  • 1
    @Martin: the a must not be inside explicit braces to be incremented at each item, so it would rather be \bgroup\color{red}a\/\egroup. Commented May 20, 2011 at 14:39
  • @Philippe: Ah, now I understand. Thanks, I didn't paid attention to the outer context enough. Commented May 20, 2011 at 14:49

You must log in to answer this question.

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