# Combining multiple diacritics from unicode input

I have trouble combining multiple diacritics in this example:

\documentclass{article}

%\usepackage[utf8]{inputenc}
%\usepackage{fontspec}

\begin{document}

Ā́ Łōgī́ zǭ́ze

\end{document}


The acute accents should always show up above everything else, but they are printed over the other diacritics. This is in xelatex:

This is an even worse output in lualatex:

It should be:

• Just out of idle curiosity: Which language is this?
– Mico
May 17, 2018 at 15:23
• @Mico This is in Kaska (British Columbia).
– jan
May 17, 2018 at 15:43
• It depends on the font. Arial e.g. is perfect, cambria ok with xelatex but not so good with lualatex, latin modern and also the tex gyre fonts are bad (and are missing the ogonek). May 17, 2018 at 15:57
• @UlrikeFischer Hmm, I see. I'm trying with some of my system fonts and most work quite well. Oh fonts ... So there is no way to make this "any font safe"?
– jan
May 17, 2018 at 16:09
• I don't think so. You could probably define some command to get better output but for automatical placement the font must imho have gpos lookups: docs.microsoft.com/en-us/typography/opentype/spec/gpos (Arial has them). May 17, 2018 at 16:12

With the Combining Diacritical Marks unicode block, you can build up the sequence of marks by hand, so to speak. They will follow the order you specify.

And they will pile up (and under) for as many as you specify.

So you can create your own combinations if you need to.

first line is ordinary text pasted in from the MWE; second line is manually built-up marks.

It becomes a case of finding the right mark.

Code

\documentclass[12pt]{article}
\usepackage[no-math]{fontspec}
\setmainfont{Noto Serif}
\newcommand\cdmacute{\symbol{"0301}}
\newcommand\cdmmacron{\symbol{"0304}}
\newcommand\cdmhook{\symbol{"0309}}
\newcommand\cdmring{\symbol{"030A}}
\newcommand\cdmdoublea{\symbol{"030B}}
\newcommand\cdmhacek{\symbol{"030C}}
\newcommand\cdmsolidus{\symbol{"0337}}
\newcommand\cdmseagull{\symbol{"033C}}
\newcommand\cdmsquare{\symbol{"033B}}
\newcommand\cdmbridge{\symbol{"033A}}
\newcommand\cdmbreve{\symbol{"032E}}
\newcommand\cdmogonek{\symbol{"0328}}

\begin{document}\
\noindent Ā́ Łōgī́ zǭ́ze

A\cdmmacron\cdmacute\ L\cdmsolidus o\cdmmacron gi\cdmmacron\cdmacute\  zo\cdmmacron\cdmacute\cdmogonek ze

A\cdmacute\cdmmacron A\cdmmacron\cdmacute

o\symbol{"0302}\symbol{"032B}

\vspace{12pt}
A\cdmhook\cdmring\cdmdoublea\cdmhacek\cdmacute\cdmseagull\cdmsquare\cdmbridge\cdmbreve
\vspace{12pt}

A\cdmsolidus B\cdmsolidus C\cdmsolidus

L\cdmsolidus

\end{document}


And with the ucharclasses package, the accents (or the letters) can be brought in from another font, if desired.