TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to have the diacritical marks stand out visually by being colored differently. For example, can I have â in which the circumflex is in red, and the 'a' is in black? When I use \textcolor{...} for the diacritical mark, it is not placed correctly over (or under) the letter.

share|improve this question

migrated from stackoverflow.com Feb 7 '13 at 16:03

This question came from our site for professional and enthusiast programmers.

up vote 6 down vote accepted

The main problem is when you use a T1 encoded font, in which accented chars are no longer composed by overimposing the diacritic on a "unaccented" char, but instead they are a new glyph which includes the diacritic as part of its design.

For this case, the only solution I can imagine is a hack: first write the accented char in red, then backtrace and draw in black the same char but without accent:


a \trick{â}{a} â


share|improve this answer
I tried this with latex on Ubuntu and just got two regular a's with no accent or color. – Joseph Garvin Jan 12 '15 at 4:58
@JosephGarvin Sounds like a encoding issue. Instead of â, try writing \^a. Also, it could be a font problem; you can try using \usepackage{lmodern} instead of \usepackage[T1]{fontenc} – JLDiaz Jan 12 '15 at 8:50

Perhaps the following:



\kern-\dimexpr(\wd\accentboxa+\wd\accentboxb)/2\relax #1}





enter image description here

share|improve this answer

Your Answer


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.