4

When I manually colorize the capitals of words the kerning breaks. Is there a way to preserve this without manually adding in negative spaces?

The error

{\color{red}W}{onder}

Wonder
4

1 Answer 1

11

Compiling your document with LuaLaTeX instead of pdfLaTeX and loading the luacolor package solves the kerning issue.

If you need to load the xcolor package as well, you should load xcolor before luacolor. E.g., if you need to load xcolor with the option table, you should run \usepackage[table]{xcolor} before running \usepackage{luacolor}.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{luacolor}
\begin{document}
\begin{tabular}{ll}
  \verb+{\color{red}W}onder+     & {\color{red}W}onder \\
  \verb+\textcolor{red}{W}onder+ & \textcolor{red}{W}onder \\
  \verb+Wonder+                  & Wonder \\
\end{tabular}
\end{document} 
0

You must log in to answer this question.

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