# Autohyphenation of compound Russian words

The title says it all... how?

There are a lot of compound Russian words that have a hyphen and they need to be hyphenated just like any other word.

Polyglossia can do this for German with "- and "= and whatnot, but nothing like that for Russian.

A command to insert a non-hyphenation-suppressing-hyphen would be nice, a command to enable hyphenation in all such words by default would be super helpful.

• Does \setdefaultlanguage[babelshorthands=true]{russian} not give you access to "= etc.? – brian-ammon Jun 1 '13 at 16:58
• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. – Claudio Fiandrino Jun 1 '13 at 17:15
• You can use babel instead of polyglossia. The most recent version of babel provides "= and works with all engines including xetex and luatex. – Igor Kotelnikov Jun 1 '13 at 17:32
• @brian-ammon: Tried that, no luck. [babelshorthands=true]{german} does work, just like the manual says, but {russian} does not. – n. 'pronouns' m. Jun 1 '13 at 17:38
• @IgorKotelnikov: Yeah, babel can do it, but I have other problems with it. – n. 'pronouns' m. Jun 1 '13 at 17:46

Babel shorthands work:

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{russian}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Old Standard}

\begin{document}
\parbox{3pt}{
\hspace{0pt}штаб"-квартиры

\bigskip

\hspace{0pt}Восточно"-Европейской
}
\end{document}


The \hspace{0pt} is used to overcome the usual problem that the first word in a paragraph would not be hyphenated. The \parbox is to force XeLaTeX to hyphenate whenever possible.

• Thanks. Apparently I was using babelshorthands incorrectly (option is not the same as option=true, silly me). However "- doesn't seem to work as intended. It produces no hyphen when word fits on the line (ВосточноЕвропейской). -"" seems to do the right things however. – n. 'pronouns' m. Jun 1 '13 at 18:54
• There was a bug with "- until last year, which would cause the behaviour you’re observing. It’s fixed in TeX Live 2012 (with Polyglossia version 1.2.1). – Arthur Reutenauer Jun 5 '13 at 15:25
• @ArthurReutenauer: perhaps, you need "= rather than "-. – Igor Kotelnikov Jun 30 '13 at 11:34
• @Igor: I don’t need anything myself, I am only reporting a bug that has been fixed in the mean time. In that particular case, updating may help the original poster. – Arthur Reutenauer Jul 30 '13 at 13:18