Proper way to typeset units such as N/m when using different body text and math font












0















I am writing a document which uses times for the main body text and the math font is the standard Latex math font (Computer modern). I am typing units such as N/m in a form which uses a backslash. I have read about the package siunitx which helps to typeset units and such. When I use siunitx without any options, it prints si{N/m} in the Computer Modern font. But I want the letters in the times font. So I use sisetup{detect-all = true, detect-family = true}.



But then when I type si{N/m} I get the same output as just typing N/m. I guess this is expected? I definitely want to use the backslash to write this unit, i.e. I don't want to write something like Nm^{-1}. Am I doing it right? I assumed the si command would help achieve 'correct' spacing for the units and the backslash. (if there is such a thing as 'correct' spacing of units like N/m). Here is an example of the output.



enter image description here



My question is am I using si correctly?



documentclass{article}
usepackage{times}
usepackage{siunitx}
sisetup{detect-all = true, detect-family = true}
begin{document}
si{N/m} or N/m
end{document}









share|improve this question


















  • 5





    is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

    – David Carlisle
    Jul 8 '18 at 20:56











  • University requirement, well rather that is how my university template is set up.

    – Brunet
    Jul 8 '18 at 20:59






  • 2





    well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

    – David Carlisle
    Jul 8 '18 at 21:17








  • 1





    I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

    – Skillmon
    Jul 8 '18 at 21:24








  • 1





    Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

    – cfr
    Jul 9 '18 at 0:49
















0















I am writing a document which uses times for the main body text and the math font is the standard Latex math font (Computer modern). I am typing units such as N/m in a form which uses a backslash. I have read about the package siunitx which helps to typeset units and such. When I use siunitx without any options, it prints si{N/m} in the Computer Modern font. But I want the letters in the times font. So I use sisetup{detect-all = true, detect-family = true}.



But then when I type si{N/m} I get the same output as just typing N/m. I guess this is expected? I definitely want to use the backslash to write this unit, i.e. I don't want to write something like Nm^{-1}. Am I doing it right? I assumed the si command would help achieve 'correct' spacing for the units and the backslash. (if there is such a thing as 'correct' spacing of units like N/m). Here is an example of the output.



enter image description here



My question is am I using si correctly?



documentclass{article}
usepackage{times}
usepackage{siunitx}
sisetup{detect-all = true, detect-family = true}
begin{document}
si{N/m} or N/m
end{document}









share|improve this question


















  • 5





    is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

    – David Carlisle
    Jul 8 '18 at 20:56











  • University requirement, well rather that is how my university template is set up.

    – Brunet
    Jul 8 '18 at 20:59






  • 2





    well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

    – David Carlisle
    Jul 8 '18 at 21:17








  • 1





    I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

    – Skillmon
    Jul 8 '18 at 21:24








  • 1





    Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

    – cfr
    Jul 9 '18 at 0:49














0












0








0








I am writing a document which uses times for the main body text and the math font is the standard Latex math font (Computer modern). I am typing units such as N/m in a form which uses a backslash. I have read about the package siunitx which helps to typeset units and such. When I use siunitx without any options, it prints si{N/m} in the Computer Modern font. But I want the letters in the times font. So I use sisetup{detect-all = true, detect-family = true}.



But then when I type si{N/m} I get the same output as just typing N/m. I guess this is expected? I definitely want to use the backslash to write this unit, i.e. I don't want to write something like Nm^{-1}. Am I doing it right? I assumed the si command would help achieve 'correct' spacing for the units and the backslash. (if there is such a thing as 'correct' spacing of units like N/m). Here is an example of the output.



enter image description here



My question is am I using si correctly?



documentclass{article}
usepackage{times}
usepackage{siunitx}
sisetup{detect-all = true, detect-family = true}
begin{document}
si{N/m} or N/m
end{document}









share|improve this question














I am writing a document which uses times for the main body text and the math font is the standard Latex math font (Computer modern). I am typing units such as N/m in a form which uses a backslash. I have read about the package siunitx which helps to typeset units and such. When I use siunitx without any options, it prints si{N/m} in the Computer Modern font. But I want the letters in the times font. So I use sisetup{detect-all = true, detect-family = true}.



But then when I type si{N/m} I get the same output as just typing N/m. I guess this is expected? I definitely want to use the backslash to write this unit, i.e. I don't want to write something like Nm^{-1}. Am I doing it right? I assumed the si command would help achieve 'correct' spacing for the units and the backslash. (if there is such a thing as 'correct' spacing of units like N/m). Here is an example of the output.



enter image description here



My question is am I using si correctly?



documentclass{article}
usepackage{times}
usepackage{siunitx}
sisetup{detect-all = true, detect-family = true}
begin{document}
si{N/m} or N/m
end{document}






siunitx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 8 '18 at 20:53









BrunetBrunet

283




283








  • 5





    is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

    – David Carlisle
    Jul 8 '18 at 20:56











  • University requirement, well rather that is how my university template is set up.

    – Brunet
    Jul 8 '18 at 20:59






  • 2





    well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

    – David Carlisle
    Jul 8 '18 at 21:17








  • 1





    I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

    – Skillmon
    Jul 8 '18 at 21:24








  • 1





    Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

    – cfr
    Jul 9 '18 at 0:49














  • 5





    is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

    – David Carlisle
    Jul 8 '18 at 20:56











  • University requirement, well rather that is how my university template is set up.

    – Brunet
    Jul 8 '18 at 20:59






  • 2





    well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

    – David Carlisle
    Jul 8 '18 at 21:17








  • 1





    I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

    – Skillmon
    Jul 8 '18 at 21:24








  • 1





    Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

    – cfr
    Jul 9 '18 at 0:49








5




5





is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

– David Carlisle
Jul 8 '18 at 20:56





is there a particular reason to use cm math with times text they famously look horrible together: Times makes cm math look horribly thin.

– David Carlisle
Jul 8 '18 at 20:56













University requirement, well rather that is how my university template is set up.

– Brunet
Jul 8 '18 at 20:59





University requirement, well rather that is how my university template is set up.

– Brunet
Jul 8 '18 at 20:59




2




2





well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

– David Carlisle
Jul 8 '18 at 21:17







well you need to hand in whatever you need to hand in, but I wouldn't worry about typographic niceties of spacing in that version, for use other than the copy you have to submit I would use cm for text and math or a times clone (eg usepackage{newtxtext,newtxmath}) for both, not a mixture.

– David Carlisle
Jul 8 '18 at 21:17






1




1





I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

– Skillmon
Jul 8 '18 at 21:24







I think it is nicer to use si{newtonpermetre} in the document and sisetup{per-mode=symbol}. This way you can later easily change the per-mode for the entire document and stay homogeneous (if necessary).

– Skillmon
Jul 8 '18 at 21:24






1




1





Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

– cfr
Jul 9 '18 at 0:49





Are you sure the university requires the mix and that the failure to change the maths font to something matching isn't just poor design on the part of the template's author? Assuming that you could submit Word, it seems very unlikely cm is required for maths.

– cfr
Jul 9 '18 at 0:49










1 Answer
1






active

oldest

votes


















0














Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the package.



For simple units, as in your example, using an siunitx macro produces the same output as typing the characters in directly.



si[detect-all]{N/m} is the same as N/m.


enter image description here



The power of the package becomes more evident when you use complex units, which quickly become awkward to typeset correctly.



si[detect-all]{N/m^2} versus N/m$^2$. % The second ^2 uses math font instead of text font.


enter image description here



Another of siunitx's strengths is that it ensures that all of your units (and numbers) are typeset consistently. As you have already discovered, you can set whether units adapt to the font around them or are always set with math font:



si{N/m} versus $si{N/m}$. % Always use math font \  
sisetup{detect-all}
si{N/m} versus $si{N/m}$. % Adapts to math or text font


enter image description here



You can also use unit macro input, which gives you more flexibility because you can use global options to affect unit typesetting.



sisetup{per-mode = reciprocal} % default setting
si{N/m} versus si{newtonpermeter}\
sisetup{per-mode = symbol}
si{N/m} versus si{newtonpermeter}


enter image description here



Sinuitx really becomes valuable when you use some other macros such as SI that ensures numbers and units are properly joined by a thin, non-breaking space,



SI{5}{N/m}\
5 si{N/m}


enter image description here



and SIrange and SIlist that automatically format ranges and lists automatically:



SIrange{0}{5}{N/m}\
SIlist{0;1;2;3;4;5}{N/m}


enter image description here






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%2f439810%2fproper-way-to-typeset-units-such-as-n-m-when-using-different-body-text-and-math%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














    Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the package.



    For simple units, as in your example, using an siunitx macro produces the same output as typing the characters in directly.



    si[detect-all]{N/m} is the same as N/m.


    enter image description here



    The power of the package becomes more evident when you use complex units, which quickly become awkward to typeset correctly.



    si[detect-all]{N/m^2} versus N/m$^2$. % The second ^2 uses math font instead of text font.


    enter image description here



    Another of siunitx's strengths is that it ensures that all of your units (and numbers) are typeset consistently. As you have already discovered, you can set whether units adapt to the font around them or are always set with math font:



    si{N/m} versus $si{N/m}$. % Always use math font \  
    sisetup{detect-all}
    si{N/m} versus $si{N/m}$. % Adapts to math or text font


    enter image description here



    You can also use unit macro input, which gives you more flexibility because you can use global options to affect unit typesetting.



    sisetup{per-mode = reciprocal} % default setting
    si{N/m} versus si{newtonpermeter}\
    sisetup{per-mode = symbol}
    si{N/m} versus si{newtonpermeter}


    enter image description here



    Sinuitx really becomes valuable when you use some other macros such as SI that ensures numbers and units are properly joined by a thin, non-breaking space,



    SI{5}{N/m}\
    5 si{N/m}


    enter image description here



    and SIrange and SIlist that automatically format ranges and lists automatically:



    SIrange{0}{5}{N/m}\
    SIlist{0;1;2;3;4;5}{N/m}


    enter image description here






    share|improve this answer




























      0














      Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the package.



      For simple units, as in your example, using an siunitx macro produces the same output as typing the characters in directly.



      si[detect-all]{N/m} is the same as N/m.


      enter image description here



      The power of the package becomes more evident when you use complex units, which quickly become awkward to typeset correctly.



      si[detect-all]{N/m^2} versus N/m$^2$. % The second ^2 uses math font instead of text font.


      enter image description here



      Another of siunitx's strengths is that it ensures that all of your units (and numbers) are typeset consistently. As you have already discovered, you can set whether units adapt to the font around them or are always set with math font:



      si{N/m} versus $si{N/m}$. % Always use math font \  
      sisetup{detect-all}
      si{N/m} versus $si{N/m}$. % Adapts to math or text font


      enter image description here



      You can also use unit macro input, which gives you more flexibility because you can use global options to affect unit typesetting.



      sisetup{per-mode = reciprocal} % default setting
      si{N/m} versus si{newtonpermeter}\
      sisetup{per-mode = symbol}
      si{N/m} versus si{newtonpermeter}


      enter image description here



      Sinuitx really becomes valuable when you use some other macros such as SI that ensures numbers and units are properly joined by a thin, non-breaking space,



      SI{5}{N/m}\
      5 si{N/m}


      enter image description here



      and SIrange and SIlist that automatically format ranges and lists automatically:



      SIrange{0}{5}{N/m}\
      SIlist{0;1;2;3;4;5}{N/m}


      enter image description here






      share|improve this answer


























        0












        0








        0







        Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the package.



        For simple units, as in your example, using an siunitx macro produces the same output as typing the characters in directly.



        si[detect-all]{N/m} is the same as N/m.


        enter image description here



        The power of the package becomes more evident when you use complex units, which quickly become awkward to typeset correctly.



        si[detect-all]{N/m^2} versus N/m$^2$. % The second ^2 uses math font instead of text font.


        enter image description here



        Another of siunitx's strengths is that it ensures that all of your units (and numbers) are typeset consistently. As you have already discovered, you can set whether units adapt to the font around them or are always set with math font:



        si{N/m} versus $si{N/m}$. % Always use math font \  
        sisetup{detect-all}
        si{N/m} versus $si{N/m}$. % Adapts to math or text font


        enter image description here



        You can also use unit macro input, which gives you more flexibility because you can use global options to affect unit typesetting.



        sisetup{per-mode = reciprocal} % default setting
        si{N/m} versus si{newtonpermeter}\
        sisetup{per-mode = symbol}
        si{N/m} versus si{newtonpermeter}


        enter image description here



        Sinuitx really becomes valuable when you use some other macros such as SI that ensures numbers and units are properly joined by a thin, non-breaking space,



        SI{5}{N/m}\
        5 si{N/m}


        enter image description here



        and SIrange and SIlist that automatically format ranges and lists automatically:



        SIrange{0}{5}{N/m}\
        SIlist{0;1;2;3;4;5}{N/m}


        enter image description here






        share|improve this answer













        Yes, you are using siunitx correctly by giving it literal input, but using unit macros will let you use more features of the package.



        For simple units, as in your example, using an siunitx macro produces the same output as typing the characters in directly.



        si[detect-all]{N/m} is the same as N/m.


        enter image description here



        The power of the package becomes more evident when you use complex units, which quickly become awkward to typeset correctly.



        si[detect-all]{N/m^2} versus N/m$^2$. % The second ^2 uses math font instead of text font.


        enter image description here



        Another of siunitx's strengths is that it ensures that all of your units (and numbers) are typeset consistently. As you have already discovered, you can set whether units adapt to the font around them or are always set with math font:



        si{N/m} versus $si{N/m}$. % Always use math font \  
        sisetup{detect-all}
        si{N/m} versus $si{N/m}$. % Adapts to math or text font


        enter image description here



        You can also use unit macro input, which gives you more flexibility because you can use global options to affect unit typesetting.



        sisetup{per-mode = reciprocal} % default setting
        si{N/m} versus si{newtonpermeter}\
        sisetup{per-mode = symbol}
        si{N/m} versus si{newtonpermeter}


        enter image description here



        Sinuitx really becomes valuable when you use some other macros such as SI that ensures numbers and units are properly joined by a thin, non-breaking space,



        SI{5}{N/m}\
        5 si{N/m}


        enter image description here



        and SIrange and SIlist that automatically format ranges and lists automatically:



        SIrange{0}{5}{N/m}\
        SIlist{0;1;2;3;4;5}{N/m}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 26 mins ago









        RobotRavenRobotRaven

        1718




        1718






























            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%2f439810%2fproper-way-to-typeset-units-such-as-n-m-when-using-different-body-text-and-math%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

            Futebolista

            Lallio

            Jornalista