0

I have to use XeTeX, because it helps to set an arbitary font both in a text and math mode (or newtxmath in a math mode).

I've noticed that the polyglossia package has a bug with the \normalfont command. Here is a detailed description of this bug by @egreg.

After the polyglossia package updating (to a recent version) in MikTeX the problem is fixed, however the following errors have been appeared:

    Undefined control sequence. ...ctlanguage *[babelshorthands=true]{russian}
Undefined control sequence. ...ctlanguage *[babelshorthands=true]{russian}
Encoding scheme `' unknown. ...ctlanguage *[babelshorthands=true]{russian}
Undefined control sequence. ^^I\begin{document}
    Undefined control sequence. ^^I\begin{document}
        Encoding scheme `' unknown. ^^I\begin{document}
            Undefined control sequence. ^^I\begin{abstr}
                Undefined control sequence. ^^I^^I\par{\normalfont
                    Undefined control sequence. ^^I^^I\par{\normalfont
                        Encoding scheme `' unknown. ^^I^^I\par{\normalfont
                            Undefined control sequence. ^^I\end{abstr}
                        Undefined control sequence. ^^I\end{abstr}
                    Encoding scheme `' unknown. ^^I\end{abstr}
                Undefined control sequence. ^^I\end{document}
            Undefined control sequence. ^^I\end{document}
        Encoding scheme `' unknown. ^^I\end{document}
    Undefined control sequence. ...ctlanguage *[babelshorthands=true]{russian}
    Undefined control sequence. ...ctlanguage *[babelshorthands=true]{russian}
    Encoding scheme `' unknown. ...ctlanguage *[babelshorthands=true]{russian}
    Overfull \hbox (29.36624pt too wide) in paragraph

in MWE:

        \documentclass[extrafontsizes,a4paper,*pt,oneside,openany]{memoir}
\usepackage{fontspec}   %[no-math] How can I use the Newton instead of newtxmath?
    %\usepackage{newtxmath} %math font of TNR type
    \usepackage{polyglossia}[2014/05/21]   
    \setmainlanguage[babelshorthands=true]{russian}  %
    \setotherlanguage{english}       
    \setmainfont{Arial} %% 
%   \setsansfont{Newton}                  
%   \setmonofont{Newton}
\newenvironment{abstr}{\small\itshape}{\normalfont\normalsize}
\begin{document}
\begin{abstr}
    \par{\normalfont Key \textbf{words}.} Hey!
\end{abstr}
\newcommand{\fn}{\expandafter\string\the\font}
{\normalsize\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}
\fontname\font\\
$ a+b$
\end{document}

Here is a good output:enter image description here

How to escape these errors? Please, I need your help!

Best regards, Vladimir

UPD1 MWE is updated.

UPD2 the screenshot of the TexStudio

enter image description here

UPD3: I've followed the recommendations of @DavidCarlisle and @UlrikeFischer to go through the full log file. After that I've found the solution here.

  • 2
    Start by making an mwe that actually can be tested on other pc. I don't have the newton font and abstr in not a defined environment. – Ulrike Fischer Dec 02 '19 at 13:55
  • 2
    note that the errors that you show are not the format of a tex error message, which would show which command is undefined. If that is a "summary" of the errors from your editor, ignore that and show the errors from the log file, in a code block so line endings are preserved. – David Carlisle Dec 02 '19 at 13:57
  • 2
    If I comment out the newton font loading I just get a single error from your example that ! LaTeX Error: Environment abstr undefined. which is not surprising as it is not defined anywhere in this code. – David Carlisle Dec 02 '19 at 14:02
  • @DavidCarlisle, thank you the MWE is updated! – Vladimir Parkhomenko Dec 02 '19 at 14:05
  • @UlrikeFischer, what font is better to use? – Vladimir Parkhomenko Dec 02 '19 at 14:05
  • 2
    @VladimirParkhomenko do you need to specify any font to show your error? The idea is to use the minimum amount of code that shows the problem. – David Carlisle Dec 02 '19 at 14:07
  • 2
    @VladimirParkhomenko you have added a code block, but as I say they are not tex error messages and they do not show which command is undefined. The tex error messages from the log file will not be of that form. – David Carlisle Dec 02 '19 at 14:08
  • @DavidCarlisle, the problem on my PC is with any language, I've just reduced \setmainfont. I need to use Newton, but now the problem is not associated with this font. – Vladimir Parkhomenko Dec 02 '19 at 14:10
  • @DavidCarlisle, I'll update the topic with a screenshot in few seconds... – Vladimir Parkhomenko Dec 02 '19 at 14:13
  • 2
    you have now used Arial (which I have actually) but many users will not, you could have left this out altogether. I would guess that you don't have russian language support installed in texlive or miktex (you haven't said which you are using) – David Carlisle Dec 02 '19 at 14:13
  • 2
    Show the complete log-file. And delete first the aux-file and recompile then at least twice. – Ulrike Fischer Dec 02 '19 at 14:18
  • 2
    note the fact that texstudio scrambles the undefined command error messages is a reported bug you could comment there and see if it could be fixed https://sourceforge.net/p/texstudio/feature-requests/1068/ – David Carlisle Dec 02 '19 at 14:27
  • @DavidCarlisle, I've found the full log file. – Vladimir Parkhomenko Dec 02 '19 at 14:32
  • @UlrikeFischer, I've submitted the full log file in the 3rd UPD. – Vladimir Parkhomenko Dec 02 '19 at 14:34
  • 1
    You seem to have made updates only as user, all files in the main tree are quite outdated and now you have clashes. Always do updates in both modes: as user and as admin. – Ulrike Fischer Dec 02 '19 at 14:35
  • @UlrikeFischer, thank you for your time. The problem seems to be solved now. I've followed your and DavidCarlise's recommendations and fixed the bug.

    https://tex.stackexchange.com/questions/413775/error-the-current-roman-font-does-not-contain-the-cyrillic-script

    – Vladimir Parkhomenko Dec 02 '19 at 14:40
  • @DavidCarlisle, thank you for your time. The problem seems to be solved now. I've followed your and UlrikeFischer's recommendations and fixed the bug. https://tex.stackexchange.com/questions/413775/error-the-current-roman-font-does-not-contain-the-cyrillic-script – Vladimir Parkhomenko Dec 02 '19 at 14:40

0 Answers0