# Greek letters wiith continuing circumflex

I've noticed that LuaTeX seems to incorrectly render continuing characters (like a circumflex, U+0302) when they follow Greek letters. I'm particularly interested in getting this to work with a monospaced font (because it comes up in code blocks):

\documentclass{article}
\usepackage{fontspec}
\setmonofont{DejaVu Sans Mono}
\begin{document}
\end{document}


I've tried several fonts and haven't been able to find one that works, and I'm wondering whether it's a general font issue or more TeX-specific.

• The Greek language doesn't use the circumflex accents. Maybe that's the reason? – Bernard Mar 3 at 20:00

I think this is font related. DejaVu Sans Mono does not work in TeX or LibreOffice.

But Noto Sans Mono works fine. Try:

\documentclass{article}
\usepackage{fontspec}
\setmonofont{Noto Sans Mono}
\begin{document}
\end{document}


• Had to turn off ligatures for that font, because they look pretty strange for a mono, but this solution works great. – user2366158 Mar 4 at 2:30

This is font related: In a Unicode fonts, the accents are mostly placed using so called anchors: Every character has a special position marked in the font file, such that a marked position of the accent is aligned with this "anchor". The font designers did not add these anchors to greek letters.

Of course you could fix this by adding the anchors yourself, but if you only need this in rare situation and only with small characters, you can just position the accent manually. Most of the time you just need \llap to place the accent over the next character and sometimes you have to \raise it too. For example:

\documentclass{article}
\usepackage{fontspec}
\setmonofont{DejaVuSansMono.ttf}
\begin{document}