# Avoid hyphenation before combining accents

Some alphabets, like the cyrillic, manage acute accented vowels by the help of unicode character 0301, the combining acute accent. This can lead to hyphenation problems, because the hyphenation character sometimes is placed between the vowel and the accent character, resulting in a misplacement of the accent like in the following example (compiled in LuaLaTex):

The word 'со́гре́ши́вши́я' is correctly hyphenated: 'о' 'U0301' - 'г'

The word 'при́сно́' has instead an incorrect hyphenation: 'и' - 'U0301' 'с' resulting in the misplacement of the accent at the beginning of the forth line.

Actually the problem can be locally avoided driving the hyphenation with the usual при́\-сно́, but I want to avoid this bug globally.

NOTE: this question is partially issued in the question Avoid hyphenation around a specific character, but I can't see how the command \lccode can handle combining accents.

This is the reference code:

\documentclass[a5paper]{memoir}

\usepackage[russian]{babel}
\usepackage{fontspec}

\setmainfont{Linux Libertine}

\setlength{\spinemargin}{55mm}
\setlrmarginsandblock{\spinemargin}{*}{1}
\checkandfixthelayout

\newcommand\TextRus{ди́це́, при́зри́ на́ лю́ди́ со́гре́ши́вши́я, яви́ я́ко́ при́сно́ си́лу Тво́ю: при́зыва́е́м.}

\begin{document}

\begin{hyphenrules}{russian}
\noindent\TextRus
\end{hyphenrules}

\end{document}

• what system are you using (the behaviour here is rather different depending on pdftex/luatex/xetex) – David Carlisle Nov 15 '16 at 10:34
• @DavidCarlisle I'm using LuaLaTex – Paolo Polesana Nov 15 '16 at 10:46
• can you add a complete test document that makes (just) the image that you show, for testing – David Carlisle Nov 15 '16 at 12:09
• Sorry! I intended to do, but I forgot! – Paolo Polesana Nov 15 '16 at 12:12

Adding 8^^^^0301 to hyph-ru.tex as suggested here (Accent in Russian above «ы» goes to next line) worked for me and suppressed the hyphenation (there is no need to rebuild the formats as lualatex loads them on the-fly anyway).
• The name of the file is hyph-ru.tex not hyphen-ru.tex. it is in ../texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyph-ru.tex. But I would really suggest to write either to the maintainer or the hyphenation mailing list tug.org/mailman/listinfo/tex-hyphen. They will be able to decide what is the best solution. – Ulrike Fischer Nov 21 '16 at 11:58