Cyrillic letters and Russian hyphenation in Plain XeTeX











up vote
3
down vote

favorite
4












What is the simplest method to tell XeTeX (not XeLaTeX) to use a font with Cyrillic letters and to apply Russian hyphenation rules?



Ideally i would like to not have to specify anything in the source files, but to get new commands rxetex and ramsxetex to compile sources in Russian.










share|improve this question




























    up vote
    3
    down vote

    favorite
    4












    What is the simplest method to tell XeTeX (not XeLaTeX) to use a font with Cyrillic letters and to apply Russian hyphenation rules?



    Ideally i would like to not have to specify anything in the source files, but to get new commands rxetex and ramsxetex to compile sources in Russian.










    share|improve this question


























      up vote
      3
      down vote

      favorite
      4









      up vote
      3
      down vote

      favorite
      4






      4





      What is the simplest method to tell XeTeX (not XeLaTeX) to use a font with Cyrillic letters and to apply Russian hyphenation rules?



      Ideally i would like to not have to specify anything in the source files, but to get new commands rxetex and ramsxetex to compile sources in Russian.










      share|improve this question















      What is the simplest method to tell XeTeX (not XeLaTeX) to use a font with Cyrillic letters and to apply Russian hyphenation rules?



      Ideally i would like to not have to specify anything in the source files, but to get new commands rxetex and ramsxetex to compile sources in Russian.







      fonts xetex plain-tex format-files






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 12 '15 at 17:06









      erreka

      3,335928




      3,335928










      asked Jun 9 '15 at 11:42









      Alexey

      6701624




      6701624






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          Replace the preloaded cm text fonts with Unicode aware ones, and use them in your documents. Asumming that you have a working XeTeX installation, try the following:




          1. Install the OTF version of the cm-unicode set of fonts into your system. You can download them from CTAN.


          2. Run fc-cache on a terminal to update the font database cache.


          3. Copy the following code into cmunfonts.tex, and input this file at the beginning of your document.



          message{cm unicode fonts!}

          fonttenrm="[cmunrm]" at 10 pt% roman text
          fontsevenrm="[cmunrm]" at 7pt
          fontfiverm="[cmunrm]" at 5pt

          fonttenbf="[cmunbx]" at 10pt % boldface extended
          fontsevenbf="[cmunbx]" at 7pt
          fontfivebf="[cmunbx]" at 5pt

          fonttentt="[cmunbtl]" at 10pt % typewriter

          fonttensl="[cmunsl]" at 10pt % slanted roman

          fonttenit="[cmunti]" at 10pt % text italic

          endinput


          Now try to xetex yourfile and see if that works.



          In general, you will need to substitute the default 7bit cm text fonts with unicode text fonts in all your font definitions in your input files.



          Now, to use russian hyphenation you need to use a format different than plain.fmt: that's untouchable. I recommend to you to install hyplain, the russian loader, and the hyphenation patterns (from hyph-utf8 package) from CTAN; check the documentation for hyplain (it's two pages), and at the appropriate place in the hylang.tex file, add russian as follows:



          input unicode-letters
          definelanguage{ru}{RU}{loadhyph-ru}
          refinelanguage{ru}{RU}{hyphenmins{2}{2}frenchspacing}{nonfrenchspacing}
          addaliasruss{ru}{RU}


          Make the format running xetex -ini *hyplain, and call xetex ^&hyplain yourfile and it will compile with cyrillic and russian hyphenation.



          Then you can make a batch file or bash script rxetex to include the line xetex ^&hyplain %1 %2 %3 %4 %5 %6 to run your russian enabled xetex in a prompt.



          I'm sorry, but I can see no way you may bypass the process of learning how to make a format.






          share|improve this answer























          • Nice to see that there are people using hyplain. ;-)
            – egreg
            Jun 9 '15 at 19:42










          • @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
            – erreka
            Jun 9 '15 at 19:47






          • 1




            There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
            – egreg
            Jun 9 '15 at 19:54










          • Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
            – erreka
            Jun 9 '15 at 22:15










          • xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
            – Alexey
            Jun 20 '15 at 21:40











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f249357%2fcyrillic-letters-and-russian-hyphenation-in-plain-xetex%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          Replace the preloaded cm text fonts with Unicode aware ones, and use them in your documents. Asumming that you have a working XeTeX installation, try the following:




          1. Install the OTF version of the cm-unicode set of fonts into your system. You can download them from CTAN.


          2. Run fc-cache on a terminal to update the font database cache.


          3. Copy the following code into cmunfonts.tex, and input this file at the beginning of your document.



          message{cm unicode fonts!}

          fonttenrm="[cmunrm]" at 10 pt% roman text
          fontsevenrm="[cmunrm]" at 7pt
          fontfiverm="[cmunrm]" at 5pt

          fonttenbf="[cmunbx]" at 10pt % boldface extended
          fontsevenbf="[cmunbx]" at 7pt
          fontfivebf="[cmunbx]" at 5pt

          fonttentt="[cmunbtl]" at 10pt % typewriter

          fonttensl="[cmunsl]" at 10pt % slanted roman

          fonttenit="[cmunti]" at 10pt % text italic

          endinput


          Now try to xetex yourfile and see if that works.



          In general, you will need to substitute the default 7bit cm text fonts with unicode text fonts in all your font definitions in your input files.



          Now, to use russian hyphenation you need to use a format different than plain.fmt: that's untouchable. I recommend to you to install hyplain, the russian loader, and the hyphenation patterns (from hyph-utf8 package) from CTAN; check the documentation for hyplain (it's two pages), and at the appropriate place in the hylang.tex file, add russian as follows:



          input unicode-letters
          definelanguage{ru}{RU}{loadhyph-ru}
          refinelanguage{ru}{RU}{hyphenmins{2}{2}frenchspacing}{nonfrenchspacing}
          addaliasruss{ru}{RU}


          Make the format running xetex -ini *hyplain, and call xetex ^&hyplain yourfile and it will compile with cyrillic and russian hyphenation.



          Then you can make a batch file or bash script rxetex to include the line xetex ^&hyplain %1 %2 %3 %4 %5 %6 to run your russian enabled xetex in a prompt.



          I'm sorry, but I can see no way you may bypass the process of learning how to make a format.






          share|improve this answer























          • Nice to see that there are people using hyplain. ;-)
            – egreg
            Jun 9 '15 at 19:42










          • @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
            – erreka
            Jun 9 '15 at 19:47






          • 1




            There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
            – egreg
            Jun 9 '15 at 19:54










          • Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
            – erreka
            Jun 9 '15 at 22:15










          • xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
            – Alexey
            Jun 20 '15 at 21:40















          up vote
          3
          down vote













          Replace the preloaded cm text fonts with Unicode aware ones, and use them in your documents. Asumming that you have a working XeTeX installation, try the following:




          1. Install the OTF version of the cm-unicode set of fonts into your system. You can download them from CTAN.


          2. Run fc-cache on a terminal to update the font database cache.


          3. Copy the following code into cmunfonts.tex, and input this file at the beginning of your document.



          message{cm unicode fonts!}

          fonttenrm="[cmunrm]" at 10 pt% roman text
          fontsevenrm="[cmunrm]" at 7pt
          fontfiverm="[cmunrm]" at 5pt

          fonttenbf="[cmunbx]" at 10pt % boldface extended
          fontsevenbf="[cmunbx]" at 7pt
          fontfivebf="[cmunbx]" at 5pt

          fonttentt="[cmunbtl]" at 10pt % typewriter

          fonttensl="[cmunsl]" at 10pt % slanted roman

          fonttenit="[cmunti]" at 10pt % text italic

          endinput


          Now try to xetex yourfile and see if that works.



          In general, you will need to substitute the default 7bit cm text fonts with unicode text fonts in all your font definitions in your input files.



          Now, to use russian hyphenation you need to use a format different than plain.fmt: that's untouchable. I recommend to you to install hyplain, the russian loader, and the hyphenation patterns (from hyph-utf8 package) from CTAN; check the documentation for hyplain (it's two pages), and at the appropriate place in the hylang.tex file, add russian as follows:



          input unicode-letters
          definelanguage{ru}{RU}{loadhyph-ru}
          refinelanguage{ru}{RU}{hyphenmins{2}{2}frenchspacing}{nonfrenchspacing}
          addaliasruss{ru}{RU}


          Make the format running xetex -ini *hyplain, and call xetex ^&hyplain yourfile and it will compile with cyrillic and russian hyphenation.



          Then you can make a batch file or bash script rxetex to include the line xetex ^&hyplain %1 %2 %3 %4 %5 %6 to run your russian enabled xetex in a prompt.



          I'm sorry, but I can see no way you may bypass the process of learning how to make a format.






          share|improve this answer























          • Nice to see that there are people using hyplain. ;-)
            – egreg
            Jun 9 '15 at 19:42










          • @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
            – erreka
            Jun 9 '15 at 19:47






          • 1




            There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
            – egreg
            Jun 9 '15 at 19:54










          • Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
            – erreka
            Jun 9 '15 at 22:15










          • xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
            – Alexey
            Jun 20 '15 at 21:40













          up vote
          3
          down vote










          up vote
          3
          down vote









          Replace the preloaded cm text fonts with Unicode aware ones, and use them in your documents. Asumming that you have a working XeTeX installation, try the following:




          1. Install the OTF version of the cm-unicode set of fonts into your system. You can download them from CTAN.


          2. Run fc-cache on a terminal to update the font database cache.


          3. Copy the following code into cmunfonts.tex, and input this file at the beginning of your document.



          message{cm unicode fonts!}

          fonttenrm="[cmunrm]" at 10 pt% roman text
          fontsevenrm="[cmunrm]" at 7pt
          fontfiverm="[cmunrm]" at 5pt

          fonttenbf="[cmunbx]" at 10pt % boldface extended
          fontsevenbf="[cmunbx]" at 7pt
          fontfivebf="[cmunbx]" at 5pt

          fonttentt="[cmunbtl]" at 10pt % typewriter

          fonttensl="[cmunsl]" at 10pt % slanted roman

          fonttenit="[cmunti]" at 10pt % text italic

          endinput


          Now try to xetex yourfile and see if that works.



          In general, you will need to substitute the default 7bit cm text fonts with unicode text fonts in all your font definitions in your input files.



          Now, to use russian hyphenation you need to use a format different than plain.fmt: that's untouchable. I recommend to you to install hyplain, the russian loader, and the hyphenation patterns (from hyph-utf8 package) from CTAN; check the documentation for hyplain (it's two pages), and at the appropriate place in the hylang.tex file, add russian as follows:



          input unicode-letters
          definelanguage{ru}{RU}{loadhyph-ru}
          refinelanguage{ru}{RU}{hyphenmins{2}{2}frenchspacing}{nonfrenchspacing}
          addaliasruss{ru}{RU}


          Make the format running xetex -ini *hyplain, and call xetex ^&hyplain yourfile and it will compile with cyrillic and russian hyphenation.



          Then you can make a batch file or bash script rxetex to include the line xetex ^&hyplain %1 %2 %3 %4 %5 %6 to run your russian enabled xetex in a prompt.



          I'm sorry, but I can see no way you may bypass the process of learning how to make a format.






          share|improve this answer














          Replace the preloaded cm text fonts with Unicode aware ones, and use them in your documents. Asumming that you have a working XeTeX installation, try the following:




          1. Install the OTF version of the cm-unicode set of fonts into your system. You can download them from CTAN.


          2. Run fc-cache on a terminal to update the font database cache.


          3. Copy the following code into cmunfonts.tex, and input this file at the beginning of your document.



          message{cm unicode fonts!}

          fonttenrm="[cmunrm]" at 10 pt% roman text
          fontsevenrm="[cmunrm]" at 7pt
          fontfiverm="[cmunrm]" at 5pt

          fonttenbf="[cmunbx]" at 10pt % boldface extended
          fontsevenbf="[cmunbx]" at 7pt
          fontfivebf="[cmunbx]" at 5pt

          fonttentt="[cmunbtl]" at 10pt % typewriter

          fonttensl="[cmunsl]" at 10pt % slanted roman

          fonttenit="[cmunti]" at 10pt % text italic

          endinput


          Now try to xetex yourfile and see if that works.



          In general, you will need to substitute the default 7bit cm text fonts with unicode text fonts in all your font definitions in your input files.



          Now, to use russian hyphenation you need to use a format different than plain.fmt: that's untouchable. I recommend to you to install hyplain, the russian loader, and the hyphenation patterns (from hyph-utf8 package) from CTAN; check the documentation for hyplain (it's two pages), and at the appropriate place in the hylang.tex file, add russian as follows:



          input unicode-letters
          definelanguage{ru}{RU}{loadhyph-ru}
          refinelanguage{ru}{RU}{hyphenmins{2}{2}frenchspacing}{nonfrenchspacing}
          addaliasruss{ru}{RU}


          Make the format running xetex -ini *hyplain, and call xetex ^&hyplain yourfile and it will compile with cyrillic and russian hyphenation.



          Then you can make a batch file or bash script rxetex to include the line xetex ^&hyplain %1 %2 %3 %4 %5 %6 to run your russian enabled xetex in a prompt.



          I'm sorry, but I can see no way you may bypass the process of learning how to make a format.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 20 '15 at 21:32









          Alexey

          6701624




          6701624










          answered Jun 9 '15 at 18:22









          erreka

          3,335928




          3,335928












          • Nice to see that there are people using hyplain. ;-)
            – egreg
            Jun 9 '15 at 19:42










          • @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
            – erreka
            Jun 9 '15 at 19:47






          • 1




            There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
            – egreg
            Jun 9 '15 at 19:54










          • Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
            – erreka
            Jun 9 '15 at 22:15










          • xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
            – Alexey
            Jun 20 '15 at 21:40


















          • Nice to see that there are people using hyplain. ;-)
            – egreg
            Jun 9 '15 at 19:42










          • @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
            – erreka
            Jun 9 '15 at 19:47






          • 1




            There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
            – egreg
            Jun 9 '15 at 19:54










          • Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
            – erreka
            Jun 9 '15 at 22:15










          • xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
            – Alexey
            Jun 20 '15 at 21:40
















          Nice to see that there are people using hyplain. ;-)
          – egreg
          Jun 9 '15 at 19:42




          Nice to see that there are people using hyplain. ;-)
          – egreg
          Jun 9 '15 at 19:42












          @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
          – erreka
          Jun 9 '15 at 19:47




          @egreg Do you think is it possible to dispense with the preloaded fonts in the code above? —And yes, hyplain is a nice hack!
          – erreka
          Jun 9 '15 at 19:47




          1




          1




          There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
          – egreg
          Jun 9 '15 at 19:54




          There's no need to define those preloaded fonts: you can't store OpenType fonts in the format anyway, so you don't save time by defining those fonts: indeed, you lose some because you load fonts that probably you won't use.
          – egreg
          Jun 9 '15 at 19:54












          Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
          – erreka
          Jun 9 '15 at 22:15




          Make sure you convert your input files to utf8 before trying to compile them. Files encoded in cp1251 will likely choke xetex.
          – erreka
          Jun 9 '15 at 22:15












          xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
          – Alexey
          Jun 20 '15 at 21:40




          xetex myfile does not work, i get ! Internal error: bad native font flag in 'map_char_to_glyph'. The error has to do with bar command in math mode and with amsppt AMSTeX package -- if i remove one or the other, there is no error.
          – Alexey
          Jun 20 '15 at 21:40


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f249357%2fcyrillic-letters-and-russian-hyphenation-in-plain-xetex%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          サソリ

          広島県道265号伴広島線

          Accessing regular linux commands in Huawei's Dopra Linux