There is the command "--- (Cyrillic emdash) defined in the babel package (for the Russian language). It is shorter than the usual English dash --- and has shorter spaces around it (also they are non-breaking as I can see). What is the width of such spaces? Is it equal to the width of the \, space?
- 197
- 4
-
Could you please add your code and an image? I did not understand well what you ask. – Sebastiano Jan 27 '17 at 17:46
-
@Sebastiano See babel-russian package documentation. – Constructor Jan 27 '17 at 17:54
-
See at the link http://tex.stackexchange.com/questions/139748/cyrillic-em-dash-is-rendered-inconsistently or http://tex.stackexchange.com/questions/344829/russian-em-dash-in-macros. I think that these are similar at your question. – Sebastiano Jan 27 '17 at 17:59
1 Answers
The command \cyrdash is responsible of printing the dash; when the current language is Russian, it prints character 22 (the same slot as the em-dash, but in T2A encoded fonts it is shorter) or does
\hbox to 0.8em{--\hss--}
when the current encoding is not T2A, which means it superimposes two en-dashes so that the overall width is 0.8em (so changing with the font). The definition of "- is a bit complicated:
\declare@shorthand{russian}{"-}{%
\def\russian@sh@tmp{%
\if\russian@sh@next-\expandafter\russian@sh@emdash
\else\expandafter\russian@sh@hyphen\fi}%
\futurelet\russian@sh@next\russian@sh@tmp}
\def\russian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
\def\russian@sh@emdash#1#2{\cdash-#1#2}
\def\cdash#1#2#3{\def\tempx@{#3}%
\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
\ifx\tempx@\tempa@\@Acdash\else
\ifx\tempx@\tempb@\@Bcdash\else
\ifx\tempx@\tempc@\@Ccdash\else
\errmessage{Wrong usage of cdash}\fi\fi\fi}
\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
\cyrdash\hskip.2em\ignorespaces}%
\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
\nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
\def\@Ccdash{\leavevmode
\nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
Basically it means that "- produces \russian@sh@hyphen, whereas "-- does \russian@sh@emdash.
The former issues \nobreak so the preceding word part can be hyphenated; then inserts a discretionary hyphen, allowing the following word part to be hyphenated.
The latter looks at the next two tokens (the first is still -); there are four cases according to the third character
"---issues\@Acdash;"--~issues\@Bcdash;"--*issues\@Cdash;- None of the above, so
"--is followed by (ignored) spaces and another token than-,~or~.
In the fourth case the error Wrong usage of cdash is raised.
The case
"---removes a preceding space if present and, in this case, inserts a nonbreaking space of width 0.2em, followed by\cyrdashand a further nonbreaking space of width 0.2em.The case
"--~removes a preceding space if present, inserts\cyrdashand then a penalty like for an explicit hyphen, ignoring following spaces.The case
"--*is for “dialogues”: no space before and the\cyrdashis followed by a space of 0.35em, ignoring following spaces.
There is an error in the definitions: "--- at the beginning of a paragraph can produce unexpected results. There should be \leavevmode at the beginning like for the other two macros.
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
%% fix the error
\makeatletter
\def\@Acdash{\leavevmode\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
\cyrdash\hskip.2em\ignorespaces}%
\makeatother
\begin{document}
\verb|"-|: a"-b
\verb|"---|: a"---b a "--- b
\verb|"--~|: a"--~b a "--~ b
\verb|"--*|: "--*a "--* a
\end{document}
- 1,121,712
-
Thank you for your detailed answer! Is
0.2emmore or less than the width of the\,space? – Constructor Jan 28 '17 at 10:24 -
@Constructor In text mode,
\,does\thinspacewhich inserts a 0.16667em kern. – egreg Jan 28 '17 at 11:12 -
One correction.
\cyrdashis provided in the Russian Language Definition File for the case if\cyrdashis not defened elesewere. In particular\cyrdashis defined inT2Aand some other cyrillic encodings and points to a slot in font files from LH bundle. – Igor Kotelnikov Sep 26 '17 at 05:43
