1

On sharelatex.com the Russian em dash works fine in document body, but does not work when used in macros. I tried to ask the support, they sent me here.

Sample project

Code:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\pagestyle{empty}

\def\foo{
qwe "--- rty
}

\begin{document}

\foo

asd "--- fgh

\end{document}

Result:

enter image description here

1
  • 1
    With out having tested it, what happens if foo is defined after begin doc? Some features have a delayed definition
    – daleif
    Commented Dec 19, 2016 at 21:41

1 Answer 1

3

With the code "--- you are using an shortcut of package babel.

To get them to work you need to use this shortcuts after \begin{document}!

The following code

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian]{babel}
\pagestyle{empty}


\begin{document}

\newcommand\foo{% <=========================== uses babel shortcuts!
  qwe "--- rty%
}

\foo

asd "--- fgh

\end{document}

gives the wished result:

enter image description here

Not the answer you're looking for? Browse other questions tagged .