Computer Modern (Default LaTeX Font) in Serbian Cyrillic Script by XeLaTeX












1















I am using usepackage{fontspec} together with the text encoding conversion file (ascii-to-serbian.tec) in order to obtain a XeLaTeX->PDF output file in Serbian Cyrillic script. TeX code (see below) is entirely typed in Latin with the Times New Roman output font. However, I am curious is it possible in such a way to produce output PDFs with a Computer Modern font that is the default font in LaTeX. There seems to be an issue in the code when {Times New Roman} is replaced with {Computer Modern}, {Computer Modern Unicode}, or similar. Any help would be highly appreciated.



documentclass{article}
usepackage{fontspec}

setmainfont[Ligatures=TeX]{Times New Roman}
newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{Times New Roman}
usepackage{polyglossia}
setmainlanguage{english}
setotherlanguage[Script=Cyrillic]{serbian}

begin{document}

Novak Djokovi'{c} in Serbian Latin script

begin{serbian}
Novak Djokovi'{c}
end{serbian}
in Serbian Cyrillic script

begin{serbian}
textbf{Novak Djokovi'{c}}
end{serbian}
in bold Serbian Cyrillic script

begin{serbian}
textit{Novak Djokovi'{c}}
end{serbian}
in italic Serbian Cyrillic script

end{document}









share|improve this question





























    1















    I am using usepackage{fontspec} together with the text encoding conversion file (ascii-to-serbian.tec) in order to obtain a XeLaTeX->PDF output file in Serbian Cyrillic script. TeX code (see below) is entirely typed in Latin with the Times New Roman output font. However, I am curious is it possible in such a way to produce output PDFs with a Computer Modern font that is the default font in LaTeX. There seems to be an issue in the code when {Times New Roman} is replaced with {Computer Modern}, {Computer Modern Unicode}, or similar. Any help would be highly appreciated.



    documentclass{article}
    usepackage{fontspec}

    setmainfont[Ligatures=TeX]{Times New Roman}
    newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{Times New Roman}
    usepackage{polyglossia}
    setmainlanguage{english}
    setotherlanguage[Script=Cyrillic]{serbian}

    begin{document}

    Novak Djokovi'{c} in Serbian Latin script

    begin{serbian}
    Novak Djokovi'{c}
    end{serbian}
    in Serbian Cyrillic script

    begin{serbian}
    textbf{Novak Djokovi'{c}}
    end{serbian}
    in bold Serbian Cyrillic script

    begin{serbian}
    textit{Novak Djokovi'{c}}
    end{serbian}
    in italic Serbian Cyrillic script

    end{document}









    share|improve this question



























      1












      1








      1


      1






      I am using usepackage{fontspec} together with the text encoding conversion file (ascii-to-serbian.tec) in order to obtain a XeLaTeX->PDF output file in Serbian Cyrillic script. TeX code (see below) is entirely typed in Latin with the Times New Roman output font. However, I am curious is it possible in such a way to produce output PDFs with a Computer Modern font that is the default font in LaTeX. There seems to be an issue in the code when {Times New Roman} is replaced with {Computer Modern}, {Computer Modern Unicode}, or similar. Any help would be highly appreciated.



      documentclass{article}
      usepackage{fontspec}

      setmainfont[Ligatures=TeX]{Times New Roman}
      newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{Times New Roman}
      usepackage{polyglossia}
      setmainlanguage{english}
      setotherlanguage[Script=Cyrillic]{serbian}

      begin{document}

      Novak Djokovi'{c} in Serbian Latin script

      begin{serbian}
      Novak Djokovi'{c}
      end{serbian}
      in Serbian Cyrillic script

      begin{serbian}
      textbf{Novak Djokovi'{c}}
      end{serbian}
      in bold Serbian Cyrillic script

      begin{serbian}
      textit{Novak Djokovi'{c}}
      end{serbian}
      in italic Serbian Cyrillic script

      end{document}









      share|improve this question
















      I am using usepackage{fontspec} together with the text encoding conversion file (ascii-to-serbian.tec) in order to obtain a XeLaTeX->PDF output file in Serbian Cyrillic script. TeX code (see below) is entirely typed in Latin with the Times New Roman output font. However, I am curious is it possible in such a way to produce output PDFs with a Computer Modern font that is the default font in LaTeX. There seems to be an issue in the code when {Times New Roman} is replaced with {Computer Modern}, {Computer Modern Unicode}, or similar. Any help would be highly appreciated.



      documentclass{article}
      usepackage{fontspec}

      setmainfont[Ligatures=TeX]{Times New Roman}
      newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{Times New Roman}
      usepackage{polyglossia}
      setmainlanguage{english}
      setotherlanguage[Script=Cyrillic]{serbian}

      begin{document}

      Novak Djokovi'{c} in Serbian Latin script

      begin{serbian}
      Novak Djokovi'{c}
      end{serbian}
      in Serbian Cyrillic script

      begin{serbian}
      textbf{Novak Djokovi'{c}}
      end{serbian}
      in bold Serbian Cyrillic script

      begin{serbian}
      textit{Novak Djokovi'{c}}
      end{serbian}
      in italic Serbian Cyrillic script

      end{document}






      xetex cyrillic computer-modern






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 3 at 15:51







      Savchenko

















      asked Feb 3 at 10:45









      SavchenkoSavchenko

      766




      766






















          1 Answer
          1






          active

          oldest

          votes


















          3














          You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:



          documentclass{article}
          usepackage{fontspec}

          %setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
          setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
          begin{document}
          Эйн текст в кириллице


          end{document}


          enter image description here






          share|improve this answer
























          • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

            – Savchenko
            Feb 3 at 15:46






          • 1





            I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

            – Ulrike Fischer
            Feb 3 at 15:51











          • I've just tried to compile the code; with no success, unfortunately.

            – Savchenko
            Feb 3 at 15:58






          • 1





            I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

            – Ulrike Fischer
            Feb 3 at 16:05











          • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

            – Savchenko
            Feb 3 at 16:17











          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',
          autoActivateHeartbeat: false,
          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%2f473158%2fcomputer-modern-default-latex-font-in-serbian-cyrillic-script-by-xelatex%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









          3














          You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:



          documentclass{article}
          usepackage{fontspec}

          %setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
          setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
          begin{document}
          Эйн текст в кириллице


          end{document}


          enter image description here






          share|improve this answer
























          • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

            – Savchenko
            Feb 3 at 15:46






          • 1





            I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

            – Ulrike Fischer
            Feb 3 at 15:51











          • I've just tried to compile the code; with no success, unfortunately.

            – Savchenko
            Feb 3 at 15:58






          • 1





            I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

            – Ulrike Fischer
            Feb 3 at 16:05











          • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

            – Savchenko
            Feb 3 at 16:17
















          3














          You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:



          documentclass{article}
          usepackage{fontspec}

          %setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
          setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
          begin{document}
          Эйн текст в кириллице


          end{document}


          enter image description here






          share|improve this answer
























          • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

            – Savchenko
            Feb 3 at 15:46






          • 1





            I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

            – Ulrike Fischer
            Feb 3 at 15:51











          • I've just tried to compile the code; with no success, unfortunately.

            – Savchenko
            Feb 3 at 15:58






          • 1





            I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

            – Ulrike Fischer
            Feb 3 at 16:05











          • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

            – Savchenko
            Feb 3 at 16:17














          3












          3








          3







          You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:



          documentclass{article}
          usepackage{fontspec}

          %setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
          setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
          begin{document}
          Эйн текст в кириллице


          end{document}


          enter image description here






          share|improve this answer













          You can use fonts from cm-unicode. They contain cyrillic and should normally work in the same way in your setup:



          documentclass{article}
          usepackage{fontspec}

          %setmainfont[Ligatures=TeX,Script=Cyrillic]{Times New Roman}
          setmainfont[Ligatures=TeX,Script=Cyrillic]{CMU Serif}
          begin{document}
          Эйн текст в кириллице


          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 3 at 13:44









          Ulrike FischerUlrike Fischer

          192k8299682




          192k8299682













          • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

            – Savchenko
            Feb 3 at 15:46






          • 1





            I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

            – Ulrike Fischer
            Feb 3 at 15:51











          • I've just tried to compile the code; with no success, unfortunately.

            – Savchenko
            Feb 3 at 15:58






          • 1





            I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

            – Ulrike Fischer
            Feb 3 at 16:05











          • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

            – Savchenko
            Feb 3 at 16:17



















          • Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

            – Savchenko
            Feb 3 at 15:46






          • 1





            I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

            – Ulrike Fischer
            Feb 3 at 15:51











          • I've just tried to compile the code; with no success, unfortunately.

            – Savchenko
            Feb 3 at 15:58






          • 1





            I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

            – Ulrike Fischer
            Feb 3 at 16:05











          • Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

            – Savchenko
            Feb 3 at 16:17

















          Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

          – Savchenko
          Feb 3 at 15:46





          Thank you Ulrike Fischer. However, the major idea is to circumvent typing text-code in Cyrillic script to avoid eventual keyboard incompatibilities with other TeX editors.

          – Savchenko
          Feb 3 at 15:46




          1




          1





          I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

          – Ulrike Fischer
          Feb 3 at 15:51





          I know. As I wrote: it should work with your setup too. I only used directly cyrillic to test if the glyphs are there - I didn't want have to install the tec-file. Did you try the font?

          – Ulrike Fischer
          Feb 3 at 15:51













          I've just tried to compile the code; with no success, unfortunately.

          – Savchenko
          Feb 3 at 15:58





          I've just tried to compile the code; with no success, unfortunately.

          – Savchenko
          Feb 3 at 15:58




          1




          1





          I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

          – Ulrike Fischer
          Feb 3 at 16:05





          I compiled the tec and tried your example with newfontfamily{serbianfont}[Mapping=ascii-to-serbian]{CMU Serif} and it works without any problems. Why did you accept the answer if it doesn't work for you?

          – Ulrike Fischer
          Feb 3 at 16:05













          Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

          – Savchenko
          Feb 3 at 16:17





          Anyhow, the answer is helpful as it refers me to look somewhere else while resolving the issue - for instance, TeX compilers, installed packages etc...

          – Savchenko
          Feb 3 at 16:17


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f473158%2fcomputer-modern-default-latex-font-in-serbian-cyrillic-script-by-xelatex%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

          mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?