Avoid fontspec warning with babel












6















I have this example



documentclass[hyperref=unicode]{beamer}

usepackage[english,nil,bidi=basic-r]{babel}
babelprovide[import=ar-DZ, main]{arabic}
babelfont{rm}{Amiri}
babelfont{sf}{Amiri}


begin{document}

begin{frame}{}
today
end{frame}

begin{frame}{}
selectlanguage{english}
today
end{frame}

end{document}


Compiled with lualatex I obtain this warning




Package fontspec Warning: Language 'English' not available for font
'Amiri'




What I have done wrong? or what I have missed?










share|improve this question























  • Why this warning keep showing?

    – Salim Bou
    Mar 8 at 21:39











  • Sorry @Salim, I noticed the warning now. You are right. But I don't know.

    – ferahfeza
    Mar 8 at 21:41
















6















I have this example



documentclass[hyperref=unicode]{beamer}

usepackage[english,nil,bidi=basic-r]{babel}
babelprovide[import=ar-DZ, main]{arabic}
babelfont{rm}{Amiri}
babelfont{sf}{Amiri}


begin{document}

begin{frame}{}
today
end{frame}

begin{frame}{}
selectlanguage{english}
today
end{frame}

end{document}


Compiled with lualatex I obtain this warning




Package fontspec Warning: Language 'English' not available for font
'Amiri'




What I have done wrong? or what I have missed?










share|improve this question























  • Why this warning keep showing?

    – Salim Bou
    Mar 8 at 21:39











  • Sorry @Salim, I noticed the warning now. You are right. But I don't know.

    – ferahfeza
    Mar 8 at 21:41














6












6








6


1






I have this example



documentclass[hyperref=unicode]{beamer}

usepackage[english,nil,bidi=basic-r]{babel}
babelprovide[import=ar-DZ, main]{arabic}
babelfont{rm}{Amiri}
babelfont{sf}{Amiri}


begin{document}

begin{frame}{}
today
end{frame}

begin{frame}{}
selectlanguage{english}
today
end{frame}

end{document}


Compiled with lualatex I obtain this warning




Package fontspec Warning: Language 'English' not available for font
'Amiri'




What I have done wrong? or what I have missed?










share|improve this question














I have this example



documentclass[hyperref=unicode]{beamer}

usepackage[english,nil,bidi=basic-r]{babel}
babelprovide[import=ar-DZ, main]{arabic}
babelfont{rm}{Amiri}
babelfont{sf}{Amiri}


begin{document}

begin{frame}{}
today
end{frame}

begin{frame}{}
selectlanguage{english}
today
end{frame}

end{document}


Compiled with lualatex I obtain this warning




Package fontspec Warning: Language 'English' not available for font
'Amiri'




What I have done wrong? or what I have missed?







beamer fontspec babel warnings






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 21:26









Salim BouSalim Bou

11.5k11542




11.5k11542













  • Why this warning keep showing?

    – Salim Bou
    Mar 8 at 21:39











  • Sorry @Salim, I noticed the warning now. You are right. But I don't know.

    – ferahfeza
    Mar 8 at 21:41



















  • Why this warning keep showing?

    – Salim Bou
    Mar 8 at 21:39











  • Sorry @Salim, I noticed the warning now. You are right. But I don't know.

    – ferahfeza
    Mar 8 at 21:41

















Why this warning keep showing?

– Salim Bou
Mar 8 at 21:39





Why this warning keep showing?

– Salim Bou
Mar 8 at 21:39













Sorry @Salim, I noticed the warning now. You are right. But I don't know.

– ferahfeza
Mar 8 at 21:41





Sorry @Salim, I noticed the warning now. You are right. But I don't know.

– ferahfeza
Mar 8 at 21:41










4 Answers
4






active

oldest

votes


















6














This bugged me for a long time too. This is what is going on:



These are the scripts and languages supported by Amiri:



DFLT        Default
arab Arabic
arab.ARA Arabic/Arabic
arab.KSH Arabic/Kashmiri
arab.SND Arabic/Sindhi
arab.URD Arabic/Urdu
latn Latin
latn.TRK Latin/Turkish


When you load Arabic with babelprovide[import=ar-DZ, main]{arabic} then babel reads in babel-ar-DZ.ini.



In this file you will find (among other things):



tag.opentype = ARA
script.tag.opentype = arab


So when Algerian Arabic is the language in use, babel will load Amiri with arab.ARA script and language. This exists in the font, so all is good.



But babel-en.ini contains this:



tag.opentype = ENG
script.tag.opentype = latn


So when English is in use, babel will try and load Amiri with latn.ENG script and language. Except this combination does not exist in the font, so a warning is issued by babel:



Language 'English' not available for font 'Amiri' with script 'Latin'.


Now all we need to do is tell babel to use Language=Default with Script=Latin for English while continuing to use Language=Arabic with Script=Arabic for Algerian Arabic.



To do this, remove english from the main babel options and instead load it like this:



babelprovide[import,language=Default]{english}


Note: babel uses language with a lowercase l as opposed to fontspec which uses Language!



babel will now load Amiri with supported options for English text and no warning is issued.



MWE



documentclass[hyperref=unicode]{beamer}

usepackage[nil,bidi=basic-r]{babel}
babelprovide[import=ar-DZ, main]{arabic}
babelprovide[import, language=Default]{english}
babelfont{rm}{Amiri}
babelfont{sf}{Amiri}

begin{document}

begin{frame}{}
today
end{frame}

begin{frame}{}
selectlanguage{english}
today
end{frame}

end{document}





share|improve this answer































    6














    You can set the language to default:



    documentclass[hyperref=unicode]{beamer}

    usepackage[english,nil,bidi=basic-r]{babel}
    babelprovide[import=ar-DZ, main]{arabic}
    babelfont{rm}[Language=Default]{Amiri}
    babelfont{sf}[Language=Default]{Amiri}


    begin{document}

    begin{frame}{}
    today
    end{frame}

    begin{frame}{}
    selectlanguage{english}
    today
    end{frame}

    end{document}





    share|improve this answer



















    • 4





      Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

      – David Purton
      Mar 9 at 6:31








    • 1





      Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

      – Javier Bezos
      Mar 9 at 8:13



















    3














    Nothing wrong, on the contrary. These warnings are shown by fontspec, not by babel. They could be irrelevant for English, but not for many other languages, including Arabic. To remove them altogether (they are only really useful when the document format is being set up), you may pass the silent option to fontspec:



    usepackage[english,nil,bidi=basic-r]{babel}
    babelprovide[import=ar-DZ, main]{arabic}
    PassOptionsToPackage{silent}{fontspec}
    babelfont{rm}{Amiri}
    babelfont{sf}{Amiri}


    Or also:



    usepackage[english,nil,bidi=basic-r]{babel}
    babelprovide[import=ar-DZ, main]{arabic}
    usepackage[silent]{fontspec}
    babelfont{rm}{Amiri}
    babelfont{sf}{Amiri}


    Edit. A 3rd option is to pass silent as a class option.






    share|improve this answer


























    • Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

      – Davislor
      Apr 1 at 16:47



















    2














    First, you can ignore this warning. It’s harmless. (However, I agree that it’s good practice to suppress meaningless warnings so that you don’t miss meaningful ones.)



    David Purton’s answer is very elegant, but there is one situation where you might need something more complex: if you’re loading different fonts for the same language that require different options. For example, a babelfont[chinese-traditional]{rm} might support Language=Chinese Traditional and a babelfont[chinese-traditional]{sf} might support CJKShape = Traditional instead. More immediately, some Arabic fonts (including Noto Sans Arabic) do not support Language=Arabic.



    In this case, you need to pass different fontspec options to the babelfont command:



    babelfont{rm}[Scale=1.0]{Amiri}
    babelfont[english]{rm}[Language=Default]{Amiri}


    However, a great multilingual companion font for Khaled Hosny’s Amiri is another of his font families, Libertinus. He based Libertinus Serif on Linux Libertine and Libertinus Sans on Linux Biolinum. I’ll let him speak as to the inspiration for the Latin letters in Amiri, but they’re a close match. There is also a math font that you can select with unicode-math.



    If you want to enable all the font features of these fonts, you might try the following:



    documentclass[hyperref=unicode]{beamer}

    usepackage[nil,bidi=basic-r]{babel}

    babelprovide[import=ar-DZ, main]{arabic}
    babelprovide[import=en, language=Default]{english}

    babelfont{rm}[Scale=1.0,
    Ligatures={Common, TeX},
    UprightFeatures={Ligatures=Discretionary},
    Numbers={OldStyle,Proportional}
    ]{Libertinus Serif}
    babelfont{sf}[Scale=MatchLowercase,
    Ligatures=TeX,
    UprightFeatures={Ligatures={Common, Discretionary}},
    BoldFeatures={Ligatures=Common}
    ]{Libertinus Sans}
    babelfont[arabic]{rm}[Scale=MatchLowercase,
    Ligatures={Common, TeX},
    Contextuals={WordInitial,WordFinal,Inner}
    ]{Amiri}


    You can use the superscripts OpenType feature with the realscripts package.



    Note that, due to a bug, Babel 3.27 and below ignores defaultfontfeatures in babelfont. I’ve worked around the bug here, but a fix is making its way into the release tree.



    At this point, because beamer uses sans-serif fonts by default, you need to define babelfont[arabic]{sf}. You can either copy the lines for babelfont[arabic]{rm} or load a sans-serif Arabic font, e.g.:



    babelfont[arabic]{sf}[Scale=MatchLowercase,
    Ligatures=Discretionary,
    Language=Default
    ]{Noto Sans Arabic}





    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',
      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%2f478487%2favoid-fontspec-warning-with-babel%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6














      This bugged me for a long time too. This is what is going on:



      These are the scripts and languages supported by Amiri:



      DFLT        Default
      arab Arabic
      arab.ARA Arabic/Arabic
      arab.KSH Arabic/Kashmiri
      arab.SND Arabic/Sindhi
      arab.URD Arabic/Urdu
      latn Latin
      latn.TRK Latin/Turkish


      When you load Arabic with babelprovide[import=ar-DZ, main]{arabic} then babel reads in babel-ar-DZ.ini.



      In this file you will find (among other things):



      tag.opentype = ARA
      script.tag.opentype = arab


      So when Algerian Arabic is the language in use, babel will load Amiri with arab.ARA script and language. This exists in the font, so all is good.



      But babel-en.ini contains this:



      tag.opentype = ENG
      script.tag.opentype = latn


      So when English is in use, babel will try and load Amiri with latn.ENG script and language. Except this combination does not exist in the font, so a warning is issued by babel:



      Language 'English' not available for font 'Amiri' with script 'Latin'.


      Now all we need to do is tell babel to use Language=Default with Script=Latin for English while continuing to use Language=Arabic with Script=Arabic for Algerian Arabic.



      To do this, remove english from the main babel options and instead load it like this:



      babelprovide[import,language=Default]{english}


      Note: babel uses language with a lowercase l as opposed to fontspec which uses Language!



      babel will now load Amiri with supported options for English text and no warning is issued.



      MWE



      documentclass[hyperref=unicode]{beamer}

      usepackage[nil,bidi=basic-r]{babel}
      babelprovide[import=ar-DZ, main]{arabic}
      babelprovide[import, language=Default]{english}
      babelfont{rm}{Amiri}
      babelfont{sf}{Amiri}

      begin{document}

      begin{frame}{}
      today
      end{frame}

      begin{frame}{}
      selectlanguage{english}
      today
      end{frame}

      end{document}





      share|improve this answer




























        6














        This bugged me for a long time too. This is what is going on:



        These are the scripts and languages supported by Amiri:



        DFLT        Default
        arab Arabic
        arab.ARA Arabic/Arabic
        arab.KSH Arabic/Kashmiri
        arab.SND Arabic/Sindhi
        arab.URD Arabic/Urdu
        latn Latin
        latn.TRK Latin/Turkish


        When you load Arabic with babelprovide[import=ar-DZ, main]{arabic} then babel reads in babel-ar-DZ.ini.



        In this file you will find (among other things):



        tag.opentype = ARA
        script.tag.opentype = arab


        So when Algerian Arabic is the language in use, babel will load Amiri with arab.ARA script and language. This exists in the font, so all is good.



        But babel-en.ini contains this:



        tag.opentype = ENG
        script.tag.opentype = latn


        So when English is in use, babel will try and load Amiri with latn.ENG script and language. Except this combination does not exist in the font, so a warning is issued by babel:



        Language 'English' not available for font 'Amiri' with script 'Latin'.


        Now all we need to do is tell babel to use Language=Default with Script=Latin for English while continuing to use Language=Arabic with Script=Arabic for Algerian Arabic.



        To do this, remove english from the main babel options and instead load it like this:



        babelprovide[import,language=Default]{english}


        Note: babel uses language with a lowercase l as opposed to fontspec which uses Language!



        babel will now load Amiri with supported options for English text and no warning is issued.



        MWE



        documentclass[hyperref=unicode]{beamer}

        usepackage[nil,bidi=basic-r]{babel}
        babelprovide[import=ar-DZ, main]{arabic}
        babelprovide[import, language=Default]{english}
        babelfont{rm}{Amiri}
        babelfont{sf}{Amiri}

        begin{document}

        begin{frame}{}
        today
        end{frame}

        begin{frame}{}
        selectlanguage{english}
        today
        end{frame}

        end{document}





        share|improve this answer


























          6












          6








          6







          This bugged me for a long time too. This is what is going on:



          These are the scripts and languages supported by Amiri:



          DFLT        Default
          arab Arabic
          arab.ARA Arabic/Arabic
          arab.KSH Arabic/Kashmiri
          arab.SND Arabic/Sindhi
          arab.URD Arabic/Urdu
          latn Latin
          latn.TRK Latin/Turkish


          When you load Arabic with babelprovide[import=ar-DZ, main]{arabic} then babel reads in babel-ar-DZ.ini.



          In this file you will find (among other things):



          tag.opentype = ARA
          script.tag.opentype = arab


          So when Algerian Arabic is the language in use, babel will load Amiri with arab.ARA script and language. This exists in the font, so all is good.



          But babel-en.ini contains this:



          tag.opentype = ENG
          script.tag.opentype = latn


          So when English is in use, babel will try and load Amiri with latn.ENG script and language. Except this combination does not exist in the font, so a warning is issued by babel:



          Language 'English' not available for font 'Amiri' with script 'Latin'.


          Now all we need to do is tell babel to use Language=Default with Script=Latin for English while continuing to use Language=Arabic with Script=Arabic for Algerian Arabic.



          To do this, remove english from the main babel options and instead load it like this:



          babelprovide[import,language=Default]{english}


          Note: babel uses language with a lowercase l as opposed to fontspec which uses Language!



          babel will now load Amiri with supported options for English text and no warning is issued.



          MWE



          documentclass[hyperref=unicode]{beamer}

          usepackage[nil,bidi=basic-r]{babel}
          babelprovide[import=ar-DZ, main]{arabic}
          babelprovide[import, language=Default]{english}
          babelfont{rm}{Amiri}
          babelfont{sf}{Amiri}

          begin{document}

          begin{frame}{}
          today
          end{frame}

          begin{frame}{}
          selectlanguage{english}
          today
          end{frame}

          end{document}





          share|improve this answer













          This bugged me for a long time too. This is what is going on:



          These are the scripts and languages supported by Amiri:



          DFLT        Default
          arab Arabic
          arab.ARA Arabic/Arabic
          arab.KSH Arabic/Kashmiri
          arab.SND Arabic/Sindhi
          arab.URD Arabic/Urdu
          latn Latin
          latn.TRK Latin/Turkish


          When you load Arabic with babelprovide[import=ar-DZ, main]{arabic} then babel reads in babel-ar-DZ.ini.



          In this file you will find (among other things):



          tag.opentype = ARA
          script.tag.opentype = arab


          So when Algerian Arabic is the language in use, babel will load Amiri with arab.ARA script and language. This exists in the font, so all is good.



          But babel-en.ini contains this:



          tag.opentype = ENG
          script.tag.opentype = latn


          So when English is in use, babel will try and load Amiri with latn.ENG script and language. Except this combination does not exist in the font, so a warning is issued by babel:



          Language 'English' not available for font 'Amiri' with script 'Latin'.


          Now all we need to do is tell babel to use Language=Default with Script=Latin for English while continuing to use Language=Arabic with Script=Arabic for Algerian Arabic.



          To do this, remove english from the main babel options and instead load it like this:



          babelprovide[import,language=Default]{english}


          Note: babel uses language with a lowercase l as opposed to fontspec which uses Language!



          babel will now load Amiri with supported options for English text and no warning is issued.



          MWE



          documentclass[hyperref=unicode]{beamer}

          usepackage[nil,bidi=basic-r]{babel}
          babelprovide[import=ar-DZ, main]{arabic}
          babelprovide[import, language=Default]{english}
          babelfont{rm}{Amiri}
          babelfont{sf}{Amiri}

          begin{document}

          begin{frame}{}
          today
          end{frame}

          begin{frame}{}
          selectlanguage{english}
          today
          end{frame}

          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 9 at 6:55









          David PurtonDavid Purton

          11.3k2944




          11.3k2944























              6














              You can set the language to default:



              documentclass[hyperref=unicode]{beamer}

              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              babelfont{rm}[Language=Default]{Amiri}
              babelfont{sf}[Language=Default]{Amiri}


              begin{document}

              begin{frame}{}
              today
              end{frame}

              begin{frame}{}
              selectlanguage{english}
              today
              end{frame}

              end{document}





              share|improve this answer



















              • 4





                Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

                – David Purton
                Mar 9 at 6:31








              • 1





                Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

                – Javier Bezos
                Mar 9 at 8:13
















              6














              You can set the language to default:



              documentclass[hyperref=unicode]{beamer}

              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              babelfont{rm}[Language=Default]{Amiri}
              babelfont{sf}[Language=Default]{Amiri}


              begin{document}

              begin{frame}{}
              today
              end{frame}

              begin{frame}{}
              selectlanguage{english}
              today
              end{frame}

              end{document}





              share|improve this answer



















              • 4





                Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

                – David Purton
                Mar 9 at 6:31








              • 1





                Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

                – Javier Bezos
                Mar 9 at 8:13














              6












              6








              6







              You can set the language to default:



              documentclass[hyperref=unicode]{beamer}

              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              babelfont{rm}[Language=Default]{Amiri}
              babelfont{sf}[Language=Default]{Amiri}


              begin{document}

              begin{frame}{}
              today
              end{frame}

              begin{frame}{}
              selectlanguage{english}
              today
              end{frame}

              end{document}





              share|improve this answer













              You can set the language to default:



              documentclass[hyperref=unicode]{beamer}

              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              babelfont{rm}[Language=Default]{Amiri}
              babelfont{sf}[Language=Default]{Amiri}


              begin{document}

              begin{frame}{}
              today
              end{frame}

              begin{frame}{}
              selectlanguage{english}
              today
              end{frame}

              end{document}






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 8 at 23:10









              Ulrike FischerUlrike Fischer

              199k9306692




              199k9306692








              • 4





                Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

                – David Purton
                Mar 9 at 6:31








              • 1





                Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

                – Javier Bezos
                Mar 9 at 8:13














              • 4





                Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

                – David Purton
                Mar 9 at 6:31








              • 1





                Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

                – Javier Bezos
                Mar 9 at 8:13








              4




              4





              Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

              – David Purton
              Mar 9 at 6:31







              Won't that change the language for both English and Arabic to Default? ar-DZ asks for Script=Arabic and Language=Arabic. I thought it was better to drop english out of the babel options and instead add in babelprovide[import,language=Default]{english}. This only changes the Language to Default for English text and leaves it as Arabic for Arabic text. (I'm not familiar enough with Arabic to know if this actually makes a difference in this case, but surely it would sometimes?)

              – David Purton
              Mar 9 at 6:31






              1




              1





              Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

              – Javier Bezos
              Mar 9 at 8:13





              Ulrike, David is right. This applies Language=Default to all languages, potentially breaking font features specific to some languages.

              – Javier Bezos
              Mar 9 at 8:13











              3














              Nothing wrong, on the contrary. These warnings are shown by fontspec, not by babel. They could be irrelevant for English, but not for many other languages, including Arabic. To remove them altogether (they are only really useful when the document format is being set up), you may pass the silent option to fontspec:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              PassOptionsToPackage{silent}{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Or also:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              usepackage[silent]{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Edit. A 3rd option is to pass silent as a class option.






              share|improve this answer


























              • Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

                – Davislor
                Apr 1 at 16:47
















              3














              Nothing wrong, on the contrary. These warnings are shown by fontspec, not by babel. They could be irrelevant for English, but not for many other languages, including Arabic. To remove them altogether (they are only really useful when the document format is being set up), you may pass the silent option to fontspec:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              PassOptionsToPackage{silent}{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Or also:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              usepackage[silent]{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Edit. A 3rd option is to pass silent as a class option.






              share|improve this answer


























              • Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

                – Davislor
                Apr 1 at 16:47














              3












              3








              3







              Nothing wrong, on the contrary. These warnings are shown by fontspec, not by babel. They could be irrelevant for English, but not for many other languages, including Arabic. To remove them altogether (they are only really useful when the document format is being set up), you may pass the silent option to fontspec:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              PassOptionsToPackage{silent}{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Or also:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              usepackage[silent]{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Edit. A 3rd option is to pass silent as a class option.






              share|improve this answer















              Nothing wrong, on the contrary. These warnings are shown by fontspec, not by babel. They could be irrelevant for English, but not for many other languages, including Arabic. To remove them altogether (they are only really useful when the document format is being set up), you may pass the silent option to fontspec:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              PassOptionsToPackage{silent}{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Or also:



              usepackage[english,nil,bidi=basic-r]{babel}
              babelprovide[import=ar-DZ, main]{arabic}
              usepackage[silent]{fontspec}
              babelfont{rm}{Amiri}
              babelfont{sf}{Amiri}


              Edit. A 3rd option is to pass silent as a class option.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 1 at 14:21

























              answered Mar 9 at 7:50









              Javier BezosJavier Bezos

              3,9151216




              3,9151216













              • Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

                – Davislor
                Apr 1 at 16:47



















              • Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

                – Davislor
                Apr 1 at 16:47

















              Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

              – Davislor
              Apr 1 at 16:47





              Personally, I would only do this as a last resort. Sometimes, fontspec warns about something important.

              – Davislor
              Apr 1 at 16:47











              2














              First, you can ignore this warning. It’s harmless. (However, I agree that it’s good practice to suppress meaningless warnings so that you don’t miss meaningful ones.)



              David Purton’s answer is very elegant, but there is one situation where you might need something more complex: if you’re loading different fonts for the same language that require different options. For example, a babelfont[chinese-traditional]{rm} might support Language=Chinese Traditional and a babelfont[chinese-traditional]{sf} might support CJKShape = Traditional instead. More immediately, some Arabic fonts (including Noto Sans Arabic) do not support Language=Arabic.



              In this case, you need to pass different fontspec options to the babelfont command:



              babelfont{rm}[Scale=1.0]{Amiri}
              babelfont[english]{rm}[Language=Default]{Amiri}


              However, a great multilingual companion font for Khaled Hosny’s Amiri is another of his font families, Libertinus. He based Libertinus Serif on Linux Libertine and Libertinus Sans on Linux Biolinum. I’ll let him speak as to the inspiration for the Latin letters in Amiri, but they’re a close match. There is also a math font that you can select with unicode-math.



              If you want to enable all the font features of these fonts, you might try the following:



              documentclass[hyperref=unicode]{beamer}

              usepackage[nil,bidi=basic-r]{babel}

              babelprovide[import=ar-DZ, main]{arabic}
              babelprovide[import=en, language=Default]{english}

              babelfont{rm}[Scale=1.0,
              Ligatures={Common, TeX},
              UprightFeatures={Ligatures=Discretionary},
              Numbers={OldStyle,Proportional}
              ]{Libertinus Serif}
              babelfont{sf}[Scale=MatchLowercase,
              Ligatures=TeX,
              UprightFeatures={Ligatures={Common, Discretionary}},
              BoldFeatures={Ligatures=Common}
              ]{Libertinus Sans}
              babelfont[arabic]{rm}[Scale=MatchLowercase,
              Ligatures={Common, TeX},
              Contextuals={WordInitial,WordFinal,Inner}
              ]{Amiri}


              You can use the superscripts OpenType feature with the realscripts package.



              Note that, due to a bug, Babel 3.27 and below ignores defaultfontfeatures in babelfont. I’ve worked around the bug here, but a fix is making its way into the release tree.



              At this point, because beamer uses sans-serif fonts by default, you need to define babelfont[arabic]{sf}. You can either copy the lines for babelfont[arabic]{rm} or load a sans-serif Arabic font, e.g.:



              babelfont[arabic]{sf}[Scale=MatchLowercase,
              Ligatures=Discretionary,
              Language=Default
              ]{Noto Sans Arabic}





              share|improve this answer






























                2














                First, you can ignore this warning. It’s harmless. (However, I agree that it’s good practice to suppress meaningless warnings so that you don’t miss meaningful ones.)



                David Purton’s answer is very elegant, but there is one situation where you might need something more complex: if you’re loading different fonts for the same language that require different options. For example, a babelfont[chinese-traditional]{rm} might support Language=Chinese Traditional and a babelfont[chinese-traditional]{sf} might support CJKShape = Traditional instead. More immediately, some Arabic fonts (including Noto Sans Arabic) do not support Language=Arabic.



                In this case, you need to pass different fontspec options to the babelfont command:



                babelfont{rm}[Scale=1.0]{Amiri}
                babelfont[english]{rm}[Language=Default]{Amiri}


                However, a great multilingual companion font for Khaled Hosny’s Amiri is another of his font families, Libertinus. He based Libertinus Serif on Linux Libertine and Libertinus Sans on Linux Biolinum. I’ll let him speak as to the inspiration for the Latin letters in Amiri, but they’re a close match. There is also a math font that you can select with unicode-math.



                If you want to enable all the font features of these fonts, you might try the following:



                documentclass[hyperref=unicode]{beamer}

                usepackage[nil,bidi=basic-r]{babel}

                babelprovide[import=ar-DZ, main]{arabic}
                babelprovide[import=en, language=Default]{english}

                babelfont{rm}[Scale=1.0,
                Ligatures={Common, TeX},
                UprightFeatures={Ligatures=Discretionary},
                Numbers={OldStyle,Proportional}
                ]{Libertinus Serif}
                babelfont{sf}[Scale=MatchLowercase,
                Ligatures=TeX,
                UprightFeatures={Ligatures={Common, Discretionary}},
                BoldFeatures={Ligatures=Common}
                ]{Libertinus Sans}
                babelfont[arabic]{rm}[Scale=MatchLowercase,
                Ligatures={Common, TeX},
                Contextuals={WordInitial,WordFinal,Inner}
                ]{Amiri}


                You can use the superscripts OpenType feature with the realscripts package.



                Note that, due to a bug, Babel 3.27 and below ignores defaultfontfeatures in babelfont. I’ve worked around the bug here, but a fix is making its way into the release tree.



                At this point, because beamer uses sans-serif fonts by default, you need to define babelfont[arabic]{sf}. You can either copy the lines for babelfont[arabic]{rm} or load a sans-serif Arabic font, e.g.:



                babelfont[arabic]{sf}[Scale=MatchLowercase,
                Ligatures=Discretionary,
                Language=Default
                ]{Noto Sans Arabic}





                share|improve this answer




























                  2












                  2








                  2







                  First, you can ignore this warning. It’s harmless. (However, I agree that it’s good practice to suppress meaningless warnings so that you don’t miss meaningful ones.)



                  David Purton’s answer is very elegant, but there is one situation where you might need something more complex: if you’re loading different fonts for the same language that require different options. For example, a babelfont[chinese-traditional]{rm} might support Language=Chinese Traditional and a babelfont[chinese-traditional]{sf} might support CJKShape = Traditional instead. More immediately, some Arabic fonts (including Noto Sans Arabic) do not support Language=Arabic.



                  In this case, you need to pass different fontspec options to the babelfont command:



                  babelfont{rm}[Scale=1.0]{Amiri}
                  babelfont[english]{rm}[Language=Default]{Amiri}


                  However, a great multilingual companion font for Khaled Hosny’s Amiri is another of his font families, Libertinus. He based Libertinus Serif on Linux Libertine and Libertinus Sans on Linux Biolinum. I’ll let him speak as to the inspiration for the Latin letters in Amiri, but they’re a close match. There is also a math font that you can select with unicode-math.



                  If you want to enable all the font features of these fonts, you might try the following:



                  documentclass[hyperref=unicode]{beamer}

                  usepackage[nil,bidi=basic-r]{babel}

                  babelprovide[import=ar-DZ, main]{arabic}
                  babelprovide[import=en, language=Default]{english}

                  babelfont{rm}[Scale=1.0,
                  Ligatures={Common, TeX},
                  UprightFeatures={Ligatures=Discretionary},
                  Numbers={OldStyle,Proportional}
                  ]{Libertinus Serif}
                  babelfont{sf}[Scale=MatchLowercase,
                  Ligatures=TeX,
                  UprightFeatures={Ligatures={Common, Discretionary}},
                  BoldFeatures={Ligatures=Common}
                  ]{Libertinus Sans}
                  babelfont[arabic]{rm}[Scale=MatchLowercase,
                  Ligatures={Common, TeX},
                  Contextuals={WordInitial,WordFinal,Inner}
                  ]{Amiri}


                  You can use the superscripts OpenType feature with the realscripts package.



                  Note that, due to a bug, Babel 3.27 and below ignores defaultfontfeatures in babelfont. I’ve worked around the bug here, but a fix is making its way into the release tree.



                  At this point, because beamer uses sans-serif fonts by default, you need to define babelfont[arabic]{sf}. You can either copy the lines for babelfont[arabic]{rm} or load a sans-serif Arabic font, e.g.:



                  babelfont[arabic]{sf}[Scale=MatchLowercase,
                  Ligatures=Discretionary,
                  Language=Default
                  ]{Noto Sans Arabic}





                  share|improve this answer















                  First, you can ignore this warning. It’s harmless. (However, I agree that it’s good practice to suppress meaningless warnings so that you don’t miss meaningful ones.)



                  David Purton’s answer is very elegant, but there is one situation where you might need something more complex: if you’re loading different fonts for the same language that require different options. For example, a babelfont[chinese-traditional]{rm} might support Language=Chinese Traditional and a babelfont[chinese-traditional]{sf} might support CJKShape = Traditional instead. More immediately, some Arabic fonts (including Noto Sans Arabic) do not support Language=Arabic.



                  In this case, you need to pass different fontspec options to the babelfont command:



                  babelfont{rm}[Scale=1.0]{Amiri}
                  babelfont[english]{rm}[Language=Default]{Amiri}


                  However, a great multilingual companion font for Khaled Hosny’s Amiri is another of his font families, Libertinus. He based Libertinus Serif on Linux Libertine and Libertinus Sans on Linux Biolinum. I’ll let him speak as to the inspiration for the Latin letters in Amiri, but they’re a close match. There is also a math font that you can select with unicode-math.



                  If you want to enable all the font features of these fonts, you might try the following:



                  documentclass[hyperref=unicode]{beamer}

                  usepackage[nil,bidi=basic-r]{babel}

                  babelprovide[import=ar-DZ, main]{arabic}
                  babelprovide[import=en, language=Default]{english}

                  babelfont{rm}[Scale=1.0,
                  Ligatures={Common, TeX},
                  UprightFeatures={Ligatures=Discretionary},
                  Numbers={OldStyle,Proportional}
                  ]{Libertinus Serif}
                  babelfont{sf}[Scale=MatchLowercase,
                  Ligatures=TeX,
                  UprightFeatures={Ligatures={Common, Discretionary}},
                  BoldFeatures={Ligatures=Common}
                  ]{Libertinus Sans}
                  babelfont[arabic]{rm}[Scale=MatchLowercase,
                  Ligatures={Common, TeX},
                  Contextuals={WordInitial,WordFinal,Inner}
                  ]{Amiri}


                  You can use the superscripts OpenType feature with the realscripts package.



                  Note that, due to a bug, Babel 3.27 and below ignores defaultfontfeatures in babelfont. I’ve worked around the bug here, but a fix is making its way into the release tree.



                  At this point, because beamer uses sans-serif fonts by default, you need to define babelfont[arabic]{sf}. You can either copy the lines for babelfont[arabic]{rm} or load a sans-serif Arabic font, e.g.:



                  babelfont[arabic]{sf}[Scale=MatchLowercase,
                  Ligatures=Discretionary,
                  Language=Default
                  ]{Noto Sans Arabic}






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 1 at 16:48

























                  answered Apr 1 at 16:35









                  DavislorDavislor

                  7,3641432




                  7,3641432






























                      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%2f478487%2favoid-fontspec-warning-with-babel%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

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix