Hi,

polyglossia documentation states, that babel shorthands ("-shorthands) are only implemented for German, Dutch and Catalan. This is wrong or at least misleading as gloss-russian.ldf does indeed invoke babelshorthands. I'm neither tex-expert nor polyglossia expert, but lines 29 to 84 from gloss-russian.ldf damn look like babelshorthands to me:

\define@boolkey{russian}[russian@]{babelshorthands}[false]{}

\setkeys{russian}{spelling,numerals}

\ifsystem@babelshorthands
  \setkeys{russian}{babelshorthands=true}
\else
  \setkeys{russian}{babelshorthands=false}
\fi

\ifcsundef{initiate@active@char}{%
  \input{babelsh.def}%
  \initiate@active@char{"}%
}{}

\def\russian@shorthands{%
  \bbl@activate{"}%
  \def\language@group{russian}%
%  \declare@shorthand{russian}{"`}{„}%
%  \declare@shorthand{russian}{"'}{“}%
%  \declare@shorthand{russian}{"<}{«}%
%  \declare@shorthand{russian}{">}{»}%
  \declare@shorthand{russian}{""}{\hskip\z@skip}%
  \declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
  \declare@shorthand{russian}{"=}{\nobreak\-\hskip\z@skip}%

\declare@shorthand{russian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
  \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}%
  \ifx\cyrdash\undefined
    \def\cyrdash{\hbox to.8em{--\hss--}}
  \fi
  \declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}%
}

\def\norussian@shorthands{%
  \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}

The real problem seems to be lines 39 to 42, in which babelsh.def is referenced, which does even more babelshorthand stuff. (probably that's why it's called babelshORTHANDS.def)

So I commented them out and your minimal example worked with polyglossia and mathspec.

Concerning mathspec, the problem is the macro \alpha which expands to "α. The double quotes are mathspecs means to overcome the missing math metrics in text fonts. It'd probably be better, to implement this differently, but they at least document it properly.

bye

Toscho

On 09.03.2012 21:11, Vadim Radionov wrote:
Hi, Tobias,

I don't need "-shorthands with unicode, but how can I switch them off?

Vadim

On Fri, Mar 9, 2012 at 7:49 PM, Tobias Schoel
<liesdieda...@googlemail.com <mailto:liesdieda...@googlemail.com>> wrote:

    When switching to xetex, I had problems with mathspec and the
    "-shorthands as well (I write in German). You should work without
    "-shorthands or without mathspec. It's probably easier to work
    without mathspec, if you can work with unicode-math instead (saying:
    you can use a suitable font).


    On 08.03.2012 22:43, Vadim Radionov wrote:

        Dear list members,

        I have a problem using mathspec with Greek key together with
        polyglossia
        with some languages, probably those using " shorthands. Check the
        following example (with and without (Greek) or Russian language
        selection):

        \documentclass{minimal}
        \usepackage{mathspec}
        \setmathsfont(Digits,Latin,__Greek){Minion Pro}

        \usepackage[no-sscript]{__xltxtra}
        \usepackage{polyglossia}

        \setdefaultlanguage{russian}
        \newfontfamily\russianfont{__Minion Pro}

        \begin{document}
        Проверка: $a+b=\alpha$
        \end{document}

        Is there any workaround, or mathspec should not be used?

        Thank you in advance,
        Vadim




    ------------------------------__--------------------
    Subscriptions, Archive, and List information, etc.:
    http://tug.org/mailman/__listinfo/xetex
    <http://tug.org/mailman/listinfo/xetex>




--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex

Reply via email to