Change only numbers' font of both text and math mode












5















I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.



I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.



Thank you.



PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.










share|improve this question


















  • 7





    Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

    – egreg
    Sep 6 '15 at 22:28











  • And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

    – cfr
    Sep 7 '15 at 1:17













  • The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

    – tipavi
    Jan 16 '18 at 13:14
















5















I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.



I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.



Thank you.



PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.










share|improve this question


















  • 7





    Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

    – egreg
    Sep 6 '15 at 22:28











  • And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

    – cfr
    Sep 7 '15 at 1:17













  • The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

    – tipavi
    Jan 16 '18 at 13:14














5












5








5








I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.



I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.



Thank you.



PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.










share|improve this question














I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.



I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.



Thank you.



PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.







fonts






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 6 '15 at 22:22









HadronHadron

261




261








  • 7





    Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

    – egreg
    Sep 6 '15 at 22:28











  • And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

    – cfr
    Sep 7 '15 at 1:17













  • The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

    – tipavi
    Jan 16 '18 at 13:14














  • 7





    Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

    – egreg
    Sep 6 '15 at 22:28











  • And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

    – cfr
    Sep 7 '15 at 1:17













  • The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

    – tipavi
    Jan 16 '18 at 13:14








7




7





Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

– egreg
Sep 6 '15 at 22:28





Welcome to TeX.SX! If I call usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.

– egreg
Sep 6 '15 at 22:28













And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

– cfr
Sep 7 '15 at 1:17







And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities.

– cfr
Sep 7 '15 at 1:17















The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

– tipavi
Jan 16 '18 at 13:14





The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?

– tipavi
Jan 16 '18 at 13:14










1 Answer
1






active

oldest

votes


















0














With XeLaTeX and fontspec it's fairly easy :



usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}


Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.






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%2f266157%2fchange-only-numbers-font-of-both-text-and-math-mode%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









    0














    With XeLaTeX and fontspec it's fairly easy :



    usepackage{fontspec}
    setmainfont{Fira Sans}
    setmathrm{Anotherfont}


    Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.






    share|improve this answer




























      0














      With XeLaTeX and fontspec it's fairly easy :



      usepackage{fontspec}
      setmainfont{Fira Sans}
      setmathrm{Anotherfont}


      Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.






      share|improve this answer


























        0












        0








        0







        With XeLaTeX and fontspec it's fairly easy :



        usepackage{fontspec}
        setmainfont{Fira Sans}
        setmathrm{Anotherfont}


        Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.






        share|improve this answer













        With XeLaTeX and fontspec it's fairly easy :



        usepackage{fontspec}
        setmainfont{Fira Sans}
        setmathrm{Anotherfont}


        Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 17 '18 at 17:51









        Rémi ZinRémi Zin

        47628




        47628






























            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%2f266157%2fchange-only-numbers-font-of-both-text-and-math-mode%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 send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?