# 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

## 1 Answer

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

Imho this means that the pattern are faulty and you should report this to the maintainers.

• Which makes the question a duplicate. – egreg Nov 20 '16 at 23:11
• @Ulrike Fischer. I'm trying to fix: when I'm done I'll grant the bounty. I'm a mac user: I opened the file from the terminal 'open -a TeXShop hyphen-ru.tex' from the right folder. Actually the file does not allow modifications, even though I'm the administrator. I'm not used in this kind of modifications: do I have to use a Unix editor? How can I get the privileges with a Mac? – Paolo Polesana Nov 21 '16 at 11:42
• @egreg, yes, it is a duplicate! Anyway my formulation seems to be much more universal, since it regards all the combining accents. Isn't it? – Paolo Polesana Nov 21 '16 at 11:45
• 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
• I wrote to the tex-hyphen list and Arthur answered that he is considering to add patterns for all combining accents. See github.com/hyphenation/tex-hyphen/issues/5. – Ulrike Fischer Nov 21 '16 at 14:03