What is a direct way of specifying a font family in XeLatex and how do you know what the “name” of the...











up vote
3
down vote

favorite












This question replaces my previous, unclear, question.



I want to use OTF fonts in XeLatex. To be concrete, here, for example, are some of the Linux Libertine fonts/fontfamilies available on my computer:



(Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RB.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RI.otf
.....

(Sans Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_I.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_M.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MB.otf
....


Suppose that I want to use to able to use all of LinLibertine fonts; roman, italics etc without defining rm, it individually. Is there a simple command(s) to do this? Can one do this for both LinLibertine (serif) and LinBiolinum (sans serif) at once. I was unable to find a suitable answer to what surely is a fundamental question.



What "name" does one use in such a command and how does one know what the "name" is. In the above example is it libertine or LinLibertine or an abbreviation (such as "cm") and does the "name" have capitals?










share|improve this question
























  • usepackage{libertine} and everything should be fine.
    – Herbert
    Nov 20 at 21:29






  • 1




    The fontspec manual has lots of examples of how you can set things up how you want them easily.
    – David Purton
    Nov 21 at 6:21










  • Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
    – Jonathan Komar
    2 days ago

















up vote
3
down vote

favorite












This question replaces my previous, unclear, question.



I want to use OTF fonts in XeLatex. To be concrete, here, for example, are some of the Linux Libertine fonts/fontfamilies available on my computer:



(Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RB.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RI.otf
.....

(Sans Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_I.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_M.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MB.otf
....


Suppose that I want to use to able to use all of LinLibertine fonts; roman, italics etc without defining rm, it individually. Is there a simple command(s) to do this? Can one do this for both LinLibertine (serif) and LinBiolinum (sans serif) at once. I was unable to find a suitable answer to what surely is a fundamental question.



What "name" does one use in such a command and how does one know what the "name" is. In the above example is it libertine or LinLibertine or an abbreviation (such as "cm") and does the "name" have capitals?










share|improve this question
























  • usepackage{libertine} and everything should be fine.
    – Herbert
    Nov 20 at 21:29






  • 1




    The fontspec manual has lots of examples of how you can set things up how you want them easily.
    – David Purton
    Nov 21 at 6:21










  • Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
    – Jonathan Komar
    2 days ago















up vote
3
down vote

favorite









up vote
3
down vote

favorite











This question replaces my previous, unclear, question.



I want to use OTF fonts in XeLatex. To be concrete, here, for example, are some of the Linux Libertine fonts/fontfamilies available on my computer:



(Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RB.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RI.otf
.....

(Sans Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_I.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_M.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MB.otf
....


Suppose that I want to use to able to use all of LinLibertine fonts; roman, italics etc without defining rm, it individually. Is there a simple command(s) to do this? Can one do this for both LinLibertine (serif) and LinBiolinum (sans serif) at once. I was unable to find a suitable answer to what surely is a fundamental question.



What "name" does one use in such a command and how does one know what the "name" is. In the above example is it libertine or LinLibertine or an abbreviation (such as "cm") and does the "name" have capitals?










share|improve this question















This question replaces my previous, unclear, question.



I want to use OTF fonts in XeLatex. To be concrete, here, for example, are some of the Linux Libertine fonts/fontfamilies available on my computer:



(Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RB.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RI.otf
.....

(Sans Serif)
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_I.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_M.otf
/usr/share/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MB.otf
....


Suppose that I want to use to able to use all of LinLibertine fonts; roman, italics etc without defining rm, it individually. Is there a simple command(s) to do this? Can one do this for both LinLibertine (serif) and LinBiolinum (sans serif) at once. I was unable to find a suitable answer to what surely is a fundamental question.



What "name" does one use in such a command and how does one know what the "name" is. In the above example is it libertine or LinLibertine or an abbreviation (such as "cm") and does the "name" have capitals?







fonts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 21:28









Herbert

265k23403712




265k23403712










asked Nov 20 at 21:20









morris roger

612




612












  • usepackage{libertine} and everything should be fine.
    – Herbert
    Nov 20 at 21:29






  • 1




    The fontspec manual has lots of examples of how you can set things up how you want them easily.
    – David Purton
    Nov 21 at 6:21










  • Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
    – Jonathan Komar
    2 days ago




















  • usepackage{libertine} and everything should be fine.
    – Herbert
    Nov 20 at 21:29






  • 1




    The fontspec manual has lots of examples of how you can set things up how you want them easily.
    – David Purton
    Nov 21 at 6:21










  • Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
    – Jonathan Komar
    2 days ago


















usepackage{libertine} and everything should be fine.
– Herbert
Nov 20 at 21:29




usepackage{libertine} and everything should be fine.
– Herbert
Nov 20 at 21:29




1




1




The fontspec manual has lots of examples of how you can set things up how you want them easily.
– David Purton
Nov 21 at 6:21




The fontspec manual has lots of examples of how you can set things up how you want them easily.
– David Purton
Nov 21 at 6:21












Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
– Jonathan Komar
2 days ago






Please clarify what you mean by “direct way”. The fonts provided in your question are included in Tex Live (so any computer that has TeX Live with fonts installed, not just your computer). Do you consider that relevant?
– Jonathan Komar
2 days ago












1 Answer
1






active

oldest

votes

















up vote
2
down vote













First things first, xelatex has one mandatory package to make use of other fonts (see texdoc fontspec documentation)



usepackage{fontspec}


After that, it makes sense to define the font family name to be the part of the filename that is common across all styles (case sensitive).



In your case:




  1. LinBiolinum

  2. LinLibertine


Then after searching for font family in the fontspec documentation, you might think to create the two new font families like this:



Define n fonts newfontfamily



You define the command name but it makes sense to use semantically relevant names.



newfontfamilyLinBiolinum[%
Extension = .otf ,
UprightFont = *_R , % roman font style (segment of file path)
ItalicFont = *_RI , % italic font style (segment of file path)
BoldFont = *_RB , % bold font style (segment of file path)
]{LinBiolinum}

newfontfamilyLinLibertine[%
Extension = .otf ,
UprightFont = *_R ,
ItalicFont = *_I ,
BoldFont = *_MB ,
]{LinLibertine}


Then anytime you want to "activate" that font in your document, just call LinBiolinum or LinLibertine. You told fontspec how to load the different styles: bold, italic, regular:



rm = /path/LinLibertine_R.otf
it = /path/LinLibertine_RI.otf
etc.



However, fontspec uses a few built-in font family commands. The one for the main font is called normalfont, and can be manually set using setmainfont like this:



setmainfont[%
Extension = .otf ,
UprightFont = *_R ,
ItalicFont = *_I ,
BoldFont = *_MB ,
]{LinLibertine}


The way these macros work are by loading fonts based on breaking font path segments into components so that some of them may be used as variables (UprightFont, ItalicFont, BoldFont, Extension, and others listed in the fontspec documentation).



The /path/ segment is set as an environment variable. Each TeX Live Installation sets a few paths by default for its internal fonts.



cat $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf


If you want to load a font from someplace other than those, you have two options




  1. Use the Path parameter in your font family definitions

  2. Add it to your path environment variable.






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: 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%2f461027%2fwhat-is-a-direct-way-of-specifying-a-font-family-in-xelatex-and-how-do-you-know%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
    2
    down vote













    First things first, xelatex has one mandatory package to make use of other fonts (see texdoc fontspec documentation)



    usepackage{fontspec}


    After that, it makes sense to define the font family name to be the part of the filename that is common across all styles (case sensitive).



    In your case:




    1. LinBiolinum

    2. LinLibertine


    Then after searching for font family in the fontspec documentation, you might think to create the two new font families like this:



    Define n fonts newfontfamily



    You define the command name but it makes sense to use semantically relevant names.



    newfontfamilyLinBiolinum[%
    Extension = .otf ,
    UprightFont = *_R , % roman font style (segment of file path)
    ItalicFont = *_RI , % italic font style (segment of file path)
    BoldFont = *_RB , % bold font style (segment of file path)
    ]{LinBiolinum}

    newfontfamilyLinLibertine[%
    Extension = .otf ,
    UprightFont = *_R ,
    ItalicFont = *_I ,
    BoldFont = *_MB ,
    ]{LinLibertine}


    Then anytime you want to "activate" that font in your document, just call LinBiolinum or LinLibertine. You told fontspec how to load the different styles: bold, italic, regular:



    rm = /path/LinLibertine_R.otf
    it = /path/LinLibertine_RI.otf
    etc.



    However, fontspec uses a few built-in font family commands. The one for the main font is called normalfont, and can be manually set using setmainfont like this:



    setmainfont[%
    Extension = .otf ,
    UprightFont = *_R ,
    ItalicFont = *_I ,
    BoldFont = *_MB ,
    ]{LinLibertine}


    The way these macros work are by loading fonts based on breaking font path segments into components so that some of them may be used as variables (UprightFont, ItalicFont, BoldFont, Extension, and others listed in the fontspec documentation).



    The /path/ segment is set as an environment variable. Each TeX Live Installation sets a few paths by default for its internal fonts.



    cat $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf


    If you want to load a font from someplace other than those, you have two options




    1. Use the Path parameter in your font family definitions

    2. Add it to your path environment variable.






    share|improve this answer



























      up vote
      2
      down vote













      First things first, xelatex has one mandatory package to make use of other fonts (see texdoc fontspec documentation)



      usepackage{fontspec}


      After that, it makes sense to define the font family name to be the part of the filename that is common across all styles (case sensitive).



      In your case:




      1. LinBiolinum

      2. LinLibertine


      Then after searching for font family in the fontspec documentation, you might think to create the two new font families like this:



      Define n fonts newfontfamily



      You define the command name but it makes sense to use semantically relevant names.



      newfontfamilyLinBiolinum[%
      Extension = .otf ,
      UprightFont = *_R , % roman font style (segment of file path)
      ItalicFont = *_RI , % italic font style (segment of file path)
      BoldFont = *_RB , % bold font style (segment of file path)
      ]{LinBiolinum}

      newfontfamilyLinLibertine[%
      Extension = .otf ,
      UprightFont = *_R ,
      ItalicFont = *_I ,
      BoldFont = *_MB ,
      ]{LinLibertine}


      Then anytime you want to "activate" that font in your document, just call LinBiolinum or LinLibertine. You told fontspec how to load the different styles: bold, italic, regular:



      rm = /path/LinLibertine_R.otf
      it = /path/LinLibertine_RI.otf
      etc.



      However, fontspec uses a few built-in font family commands. The one for the main font is called normalfont, and can be manually set using setmainfont like this:



      setmainfont[%
      Extension = .otf ,
      UprightFont = *_R ,
      ItalicFont = *_I ,
      BoldFont = *_MB ,
      ]{LinLibertine}


      The way these macros work are by loading fonts based on breaking font path segments into components so that some of them may be used as variables (UprightFont, ItalicFont, BoldFont, Extension, and others listed in the fontspec documentation).



      The /path/ segment is set as an environment variable. Each TeX Live Installation sets a few paths by default for its internal fonts.



      cat $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf


      If you want to load a font from someplace other than those, you have two options




      1. Use the Path parameter in your font family definitions

      2. Add it to your path environment variable.






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        First things first, xelatex has one mandatory package to make use of other fonts (see texdoc fontspec documentation)



        usepackage{fontspec}


        After that, it makes sense to define the font family name to be the part of the filename that is common across all styles (case sensitive).



        In your case:




        1. LinBiolinum

        2. LinLibertine


        Then after searching for font family in the fontspec documentation, you might think to create the two new font families like this:



        Define n fonts newfontfamily



        You define the command name but it makes sense to use semantically relevant names.



        newfontfamilyLinBiolinum[%
        Extension = .otf ,
        UprightFont = *_R , % roman font style (segment of file path)
        ItalicFont = *_RI , % italic font style (segment of file path)
        BoldFont = *_RB , % bold font style (segment of file path)
        ]{LinBiolinum}

        newfontfamilyLinLibertine[%
        Extension = .otf ,
        UprightFont = *_R ,
        ItalicFont = *_I ,
        BoldFont = *_MB ,
        ]{LinLibertine}


        Then anytime you want to "activate" that font in your document, just call LinBiolinum or LinLibertine. You told fontspec how to load the different styles: bold, italic, regular:



        rm = /path/LinLibertine_R.otf
        it = /path/LinLibertine_RI.otf
        etc.



        However, fontspec uses a few built-in font family commands. The one for the main font is called normalfont, and can be manually set using setmainfont like this:



        setmainfont[%
        Extension = .otf ,
        UprightFont = *_R ,
        ItalicFont = *_I ,
        BoldFont = *_MB ,
        ]{LinLibertine}


        The way these macros work are by loading fonts based on breaking font path segments into components so that some of them may be used as variables (UprightFont, ItalicFont, BoldFont, Extension, and others listed in the fontspec documentation).



        The /path/ segment is set as an environment variable. Each TeX Live Installation sets a few paths by default for its internal fonts.



        cat $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf


        If you want to load a font from someplace other than those, you have two options




        1. Use the Path parameter in your font family definitions

        2. Add it to your path environment variable.






        share|improve this answer














        First things first, xelatex has one mandatory package to make use of other fonts (see texdoc fontspec documentation)



        usepackage{fontspec}


        After that, it makes sense to define the font family name to be the part of the filename that is common across all styles (case sensitive).



        In your case:




        1. LinBiolinum

        2. LinLibertine


        Then after searching for font family in the fontspec documentation, you might think to create the two new font families like this:



        Define n fonts newfontfamily



        You define the command name but it makes sense to use semantically relevant names.



        newfontfamilyLinBiolinum[%
        Extension = .otf ,
        UprightFont = *_R , % roman font style (segment of file path)
        ItalicFont = *_RI , % italic font style (segment of file path)
        BoldFont = *_RB , % bold font style (segment of file path)
        ]{LinBiolinum}

        newfontfamilyLinLibertine[%
        Extension = .otf ,
        UprightFont = *_R ,
        ItalicFont = *_I ,
        BoldFont = *_MB ,
        ]{LinLibertine}


        Then anytime you want to "activate" that font in your document, just call LinBiolinum or LinLibertine. You told fontspec how to load the different styles: bold, italic, regular:



        rm = /path/LinLibertine_R.otf
        it = /path/LinLibertine_RI.otf
        etc.



        However, fontspec uses a few built-in font family commands. The one for the main font is called normalfont, and can be manually set using setmainfont like this:



        setmainfont[%
        Extension = .otf ,
        UprightFont = *_R ,
        ItalicFont = *_I ,
        BoldFont = *_MB ,
        ]{LinLibertine}


        The way these macros work are by loading fonts based on breaking font path segments into components so that some of them may be used as variables (UprightFont, ItalicFont, BoldFont, Extension, and others listed in the fontspec documentation).



        The /path/ segment is set as an environment variable. Each TeX Live Installation sets a few paths by default for its internal fonts.



        cat $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf


        If you want to load a font from someplace other than those, you have two options




        1. Use the Path parameter in your font family definitions

        2. Add it to your path environment variable.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 23 at 6:21

























        answered Nov 22 at 12:03









        Jonathan Komar

        6,44632977




        6,44632977






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461027%2fwhat-is-a-direct-way-of-specifying-a-font-family-in-xelatex-and-how-do-you-know%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

            How to change which sound is reproduced for terminal bell?

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

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents