LaTeX Fonts with fontspec-package

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












Today i figured out how to use system-installed-fonts with the fontspec-package and LuaLaTeX. But i can't figure out how to use fonts, that are installed in my texmf-tree!



The fontspec-Manual says (p. 10), that LuaLaTeX will see fonts installed in my texmf-tree and i can enter the name via a human readable-string (eg. Latin Modern Roman) or the filename (eg. ec-lmr10.tmf).



Even though i have confirmed that this file (and hence the font) is installed on my system in my texmf-tree, i can't get it to compile! I always get a



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "ec-lmr10.tfm" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.13 setmainfontec-lmr10.tfm

?


Am i getting something wrong?
How can i use LaTeX-fonts with fontspec and LuaLaTeX?







share|improve this question
















  • 1




    you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
    – David Carlisle
    Sep 1 at 13:44










  • What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
    – TeXnician
    Sep 1 at 13:45











  • The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
    – Tim Hilt
    Sep 1 at 14:15











  • @TimHilt The file name is lmroman10-regular.otf (for 10 pt)
    – Joseph Wright♦
    Sep 1 at 14:19














up vote
4
down vote

favorite












Today i figured out how to use system-installed-fonts with the fontspec-package and LuaLaTeX. But i can't figure out how to use fonts, that are installed in my texmf-tree!



The fontspec-Manual says (p. 10), that LuaLaTeX will see fonts installed in my texmf-tree and i can enter the name via a human readable-string (eg. Latin Modern Roman) or the filename (eg. ec-lmr10.tmf).



Even though i have confirmed that this file (and hence the font) is installed on my system in my texmf-tree, i can't get it to compile! I always get a



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "ec-lmr10.tfm" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.13 setmainfontec-lmr10.tfm

?


Am i getting something wrong?
How can i use LaTeX-fonts with fontspec and LuaLaTeX?







share|improve this question
















  • 1




    you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
    – David Carlisle
    Sep 1 at 13:44










  • What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
    – TeXnician
    Sep 1 at 13:45











  • The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
    – Tim Hilt
    Sep 1 at 14:15











  • @TimHilt The file name is lmroman10-regular.otf (for 10 pt)
    – Joseph Wright♦
    Sep 1 at 14:19












up vote
4
down vote

favorite









up vote
4
down vote

favorite











Today i figured out how to use system-installed-fonts with the fontspec-package and LuaLaTeX. But i can't figure out how to use fonts, that are installed in my texmf-tree!



The fontspec-Manual says (p. 10), that LuaLaTeX will see fonts installed in my texmf-tree and i can enter the name via a human readable-string (eg. Latin Modern Roman) or the filename (eg. ec-lmr10.tmf).



Even though i have confirmed that this file (and hence the font) is installed on my system in my texmf-tree, i can't get it to compile! I always get a



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "ec-lmr10.tfm" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.13 setmainfontec-lmr10.tfm

?


Am i getting something wrong?
How can i use LaTeX-fonts with fontspec and LuaLaTeX?







share|improve this question












Today i figured out how to use system-installed-fonts with the fontspec-package and LuaLaTeX. But i can't figure out how to use fonts, that are installed in my texmf-tree!



The fontspec-Manual says (p. 10), that LuaLaTeX will see fonts installed in my texmf-tree and i can enter the name via a human readable-string (eg. Latin Modern Roman) or the filename (eg. ec-lmr10.tmf).



Even though i have confirmed that this file (and hence the font) is installed on my system in my texmf-tree, i can't get it to compile! I always get a



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "ec-lmr10.tfm" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.13 setmainfontec-lmr10.tfm

?


Am i getting something wrong?
How can i use LaTeX-fonts with fontspec and LuaLaTeX?









share|improve this question











share|improve this question




share|improve this question










asked Sep 1 at 13:33









Tim Hilt

536




536







  • 1




    you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
    – David Carlisle
    Sep 1 at 13:44










  • What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
    – TeXnician
    Sep 1 at 13:45











  • The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
    – Tim Hilt
    Sep 1 at 14:15











  • @TimHilt The file name is lmroman10-regular.otf (for 10 pt)
    – Joseph Wright♦
    Sep 1 at 14:19












  • 1




    you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
    – David Carlisle
    Sep 1 at 13:44










  • What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
    – TeXnician
    Sep 1 at 13:45











  • The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
    – Tim Hilt
    Sep 1 at 14:15











  • @TimHilt The file name is lmroman10-regular.otf (for 10 pt)
    – Joseph Wright♦
    Sep 1 at 14:19







1




1




you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
– David Carlisle
Sep 1 at 13:44




you can not load tfm fonts via fontspec (latin modern is available as OpenType, and is the default font in lualatex so you do not have to do anything at all toi get latin modern)
– David Carlisle
Sep 1 at 13:44












What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
– TeXnician
Sep 1 at 13:45





What is wrong with usepackagelmodern if you want to use these fonts if not using the default ones?
– TeXnician
Sep 1 at 13:45













The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
– Tim Hilt
Sep 1 at 14:15





The question wasn't specifically about Latin Modern, it was about fonts in the texmf-tree! So, in general i would be better of with installing the desired font manually and using it like a system-font?
– Tim Hilt
Sep 1 at 14:15













@TimHilt The file name is lmroman10-regular.otf (for 10 pt)
– Joseph Wright♦
Sep 1 at 14:19




@TimHilt The file name is lmroman10-regular.otf (for 10 pt)
– Joseph Wright♦
Sep 1 at 14:19










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










fontspec is made for Open-Type-Fonts, that's why the .tfm-file didn't work. Also, @JosephWright pointed out the right name for the mentioned Latin Modern Roman font which i can therefore use with fontspec.



When i may want or need a certain font, .ttf or .otf would be the best format for fontspec to deal with. Such fonts can be found with



fc-list | grep <font-name>*.ttf
fc-list | grep <font-name>*.otf


for system-installed-fonts or



find /usr/share/texmf-dist/fonts/ -name <file-name>.ttf
find /usr/share/texmf-dist/fonts/ -name <file-name>.otf


for fonts in my texmf-tree.



If some font is not installed in my system or not available in the desired format through the tex-installation, there's the possibility to install the font via a package or put the matching .ttf / .otf file in .fonts and run fc-cache -f -v to update fc-list.






share|improve this answer



























    up vote
    2
    down vote













    documentclassarticle
    begindocument
    foo
    enddocument


    running with current lualatex from TeXLive creates a document with the icluded Latin Modern:



    $ pdffonts zzz2.pdf 
    name type encoding emb sub uni object ID
    ------------------------- ----------------- ---------------- --- --- --- ---------
    NAGORB+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 4 0





    share|improve this answer




















      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: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      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%2f448840%2flatex-fonts-with-fontspec-package%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote



      accepted










      fontspec is made for Open-Type-Fonts, that's why the .tfm-file didn't work. Also, @JosephWright pointed out the right name for the mentioned Latin Modern Roman font which i can therefore use with fontspec.



      When i may want or need a certain font, .ttf or .otf would be the best format for fontspec to deal with. Such fonts can be found with



      fc-list | grep <font-name>*.ttf
      fc-list | grep <font-name>*.otf


      for system-installed-fonts or



      find /usr/share/texmf-dist/fonts/ -name <file-name>.ttf
      find /usr/share/texmf-dist/fonts/ -name <file-name>.otf


      for fonts in my texmf-tree.



      If some font is not installed in my system or not available in the desired format through the tex-installation, there's the possibility to install the font via a package or put the matching .ttf / .otf file in .fonts and run fc-cache -f -v to update fc-list.






      share|improve this answer
























        up vote
        3
        down vote



        accepted










        fontspec is made for Open-Type-Fonts, that's why the .tfm-file didn't work. Also, @JosephWright pointed out the right name for the mentioned Latin Modern Roman font which i can therefore use with fontspec.



        When i may want or need a certain font, .ttf or .otf would be the best format for fontspec to deal with. Such fonts can be found with



        fc-list | grep <font-name>*.ttf
        fc-list | grep <font-name>*.otf


        for system-installed-fonts or



        find /usr/share/texmf-dist/fonts/ -name <file-name>.ttf
        find /usr/share/texmf-dist/fonts/ -name <file-name>.otf


        for fonts in my texmf-tree.



        If some font is not installed in my system or not available in the desired format through the tex-installation, there's the possibility to install the font via a package or put the matching .ttf / .otf file in .fonts and run fc-cache -f -v to update fc-list.






        share|improve this answer






















          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          fontspec is made for Open-Type-Fonts, that's why the .tfm-file didn't work. Also, @JosephWright pointed out the right name for the mentioned Latin Modern Roman font which i can therefore use with fontspec.



          When i may want or need a certain font, .ttf or .otf would be the best format for fontspec to deal with. Such fonts can be found with



          fc-list | grep <font-name>*.ttf
          fc-list | grep <font-name>*.otf


          for system-installed-fonts or



          find /usr/share/texmf-dist/fonts/ -name <file-name>.ttf
          find /usr/share/texmf-dist/fonts/ -name <file-name>.otf


          for fonts in my texmf-tree.



          If some font is not installed in my system or not available in the desired format through the tex-installation, there's the possibility to install the font via a package or put the matching .ttf / .otf file in .fonts and run fc-cache -f -v to update fc-list.






          share|improve this answer












          fontspec is made for Open-Type-Fonts, that's why the .tfm-file didn't work. Also, @JosephWright pointed out the right name for the mentioned Latin Modern Roman font which i can therefore use with fontspec.



          When i may want or need a certain font, .ttf or .otf would be the best format for fontspec to deal with. Such fonts can be found with



          fc-list | grep <font-name>*.ttf
          fc-list | grep <font-name>*.otf


          for system-installed-fonts or



          find /usr/share/texmf-dist/fonts/ -name <file-name>.ttf
          find /usr/share/texmf-dist/fonts/ -name <file-name>.otf


          for fonts in my texmf-tree.



          If some font is not installed in my system or not available in the desired format through the tex-installation, there's the possibility to install the font via a package or put the matching .ttf / .otf file in .fonts and run fc-cache -f -v to update fc-list.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 1 at 15:27









          Tim Hilt

          536




          536




















              up vote
              2
              down vote













              documentclassarticle
              begindocument
              foo
              enddocument


              running with current lualatex from TeXLive creates a document with the icluded Latin Modern:



              $ pdffonts zzz2.pdf 
              name type encoding emb sub uni object ID
              ------------------------- ----------------- ---------------- --- --- --- ---------
              NAGORB+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 4 0





              share|improve this answer
























                up vote
                2
                down vote













                documentclassarticle
                begindocument
                foo
                enddocument


                running with current lualatex from TeXLive creates a document with the icluded Latin Modern:



                $ pdffonts zzz2.pdf 
                name type encoding emb sub uni object ID
                ------------------------- ----------------- ---------------- --- --- --- ---------
                NAGORB+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 4 0





                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  documentclassarticle
                  begindocument
                  foo
                  enddocument


                  running with current lualatex from TeXLive creates a document with the icluded Latin Modern:



                  $ pdffonts zzz2.pdf 
                  name type encoding emb sub uni object ID
                  ------------------------- ----------------- ---------------- --- --- --- ---------
                  NAGORB+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 4 0





                  share|improve this answer












                  documentclassarticle
                  begindocument
                  foo
                  enddocument


                  running with current lualatex from TeXLive creates a document with the icluded Latin Modern:



                  $ pdffonts zzz2.pdf 
                  name type encoding emb sub uni object ID
                  ------------------------- ----------------- ---------------- --- --- --- ---------
                  NAGORB+LMRoman10-Regular CID Type 0C Identity-H yes yes yes 4 0






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 1 at 14:04









                  Herbert

                  261k21395705




                  261k21395705



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448840%2flatex-fonts-with-fontspec-package%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      List of Gilmore Girls characters

                      Confectionery