Sign up ×
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.

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 Feb 7 '13 at 16:03

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

2 Answers 2

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 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 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.