I'm new to ConTeXt, and I feel very excited about its capabilities. But as soon as I've tried to make a handsome document in Russian, I've learned that ConTeXt doesn't seem to provide Babel-shorthands as (Lua/Xe/pdf)LaTeX have used to:
% pdfLaTeX code
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\begin{document}
"--* Прямая речь "--- "<после "`тире"' неразрывный пробел">.
\end{document}
The code above contains a direct speech dash, a Cyrillic em-dash and two types of quote marks, and produces:
Unsurprisingly, ConTeXt recognizes none of those shorthands:
% ConTeXt code
\mainlanguage[russian]
\setupbodyfont[libertine]
\starttext
"--* Прямая речь "--- "<после "`тире"' неразрывный пробел">.
\stoptext
While quote marks can be substituted with corresponding font characters (« » „ ‟) , the specific Cyrillic dash "---
(which is shorter than em-dash, and has fixed spaces around it with non-breaking one at left side) can't be, and I've yet to figure out a way of typing or implementing it.
Is there a way of enabling Babel shorthands or implementing their functionality in ConTeXt?
(Thanks and Happy New Year!)
UPD1: I've found that a nicer way to define \cyrdash
symbol would be something like
\define\cyrdash{\scale[sx=0.9]{---}} % produces a smoother dash
Also here's how "---
is defined in Babel:
\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
\cyrdash\hskip.2em\ignorespaces}%
UPD2: I was able to recreate the desired behavior with translate
module:
\define\cyrdash{\scale[sx=0.80]{---}} % Cyrillic dash sign
\usemodule[translate]
\translateinput["---][\unskip\thinspace\cyrdash\thinspace\ignorespaces] % Cyrillic text em-dash
\translateinput["--*][\leavevmode\cyrdash\hskip.35em] % Cyrillic direct speech dash
\mainlanguage[russian]
\setupbodyfont[dejavu]
\starttext\enableinputtranslation
"--* Прямая речь "--- \quotation{после \quote{тире} неразрывный пробел}.
\stoptext
(Many thanks to @Aditya for suggestions)