Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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. –  Martin Scharrer May 20 '11 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. –  Philippe Goutet May 20 '11 at 14:39
    
@Philippe: Ah, now I understand. Thanks, I didn't paid attention to the outer context enough. –  Martin Scharrer May 20 '11 at 14:49
    
very nice solution, thanks a lot. –  Meho R. May 20 '11 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.