Need help with font and siunitx issue?

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











up vote
2
down vote

favorite












I don't really understand anything about fonts, as much as I have tried to read about them. I ultimately just wanted a font that kinda looked like it was written in a typewriter style, which also had clear math symbols to read. I found an example somewhere here on the stackexchange (see link below), used pdflatex to compile it, I thought it looked ok. But some of the math fonts, when using siunitx look squashed in the inline math mode.



My minimum working example is this:



documentclass[a4paper,openany]book

usepackage[variablett]lmodern % line 2
renewcommand*familydefaultttdefault % line 3
usepackagesiunitx

sisetup
detect-all = true,
detect-inline-family = text,
detect-inline-weight = text


begindocument

noindent normal text: [SI5millimetersquared] \
inline math mode: $[SI5millimetersquared]$ \
mm

enddocument


If I just use the default fonts, i.e. remove line 2 and 3, then use siunitx, the "mm" looks like the same font as the text.



Can anyone help me prevent the text getting squashed like this, or suggest an alternative font that won't have this issue?



Link:
textbf does not work with cmvtt style



EDIT: I edited the MWE with sisetup but was not able to fix the issue.










share|improve this question



























    up vote
    2
    down vote

    favorite












    I don't really understand anything about fonts, as much as I have tried to read about them. I ultimately just wanted a font that kinda looked like it was written in a typewriter style, which also had clear math symbols to read. I found an example somewhere here on the stackexchange (see link below), used pdflatex to compile it, I thought it looked ok. But some of the math fonts, when using siunitx look squashed in the inline math mode.



    My minimum working example is this:



    documentclass[a4paper,openany]book

    usepackage[variablett]lmodern % line 2
    renewcommand*familydefaultttdefault % line 3
    usepackagesiunitx

    sisetup
    detect-all = true,
    detect-inline-family = text,
    detect-inline-weight = text


    begindocument

    noindent normal text: [SI5millimetersquared] \
    inline math mode: $[SI5millimetersquared]$ \
    mm

    enddocument


    If I just use the default fonts, i.e. remove line 2 and 3, then use siunitx, the "mm" looks like the same font as the text.



    Can anyone help me prevent the text getting squashed like this, or suggest an alternative font that won't have this issue?



    Link:
    textbf does not work with cmvtt style



    EDIT: I edited the MWE with sisetup but was not able to fix the issue.










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I don't really understand anything about fonts, as much as I have tried to read about them. I ultimately just wanted a font that kinda looked like it was written in a typewriter style, which also had clear math symbols to read. I found an example somewhere here on the stackexchange (see link below), used pdflatex to compile it, I thought it looked ok. But some of the math fonts, when using siunitx look squashed in the inline math mode.



      My minimum working example is this:



      documentclass[a4paper,openany]book

      usepackage[variablett]lmodern % line 2
      renewcommand*familydefaultttdefault % line 3
      usepackagesiunitx

      sisetup
      detect-all = true,
      detect-inline-family = text,
      detect-inline-weight = text


      begindocument

      noindent normal text: [SI5millimetersquared] \
      inline math mode: $[SI5millimetersquared]$ \
      mm

      enddocument


      If I just use the default fonts, i.e. remove line 2 and 3, then use siunitx, the "mm" looks like the same font as the text.



      Can anyone help me prevent the text getting squashed like this, or suggest an alternative font that won't have this issue?



      Link:
      textbf does not work with cmvtt style



      EDIT: I edited the MWE with sisetup but was not able to fix the issue.










      share|improve this question















      I don't really understand anything about fonts, as much as I have tried to read about them. I ultimately just wanted a font that kinda looked like it was written in a typewriter style, which also had clear math symbols to read. I found an example somewhere here on the stackexchange (see link below), used pdflatex to compile it, I thought it looked ok. But some of the math fonts, when using siunitx look squashed in the inline math mode.



      My minimum working example is this:



      documentclass[a4paper,openany]book

      usepackage[variablett]lmodern % line 2
      renewcommand*familydefaultttdefault % line 3
      usepackagesiunitx

      sisetup
      detect-all = true,
      detect-inline-family = text,
      detect-inline-weight = text


      begindocument

      noindent normal text: [SI5millimetersquared] \
      inline math mode: $[SI5millimetersquared]$ \
      mm

      enddocument


      If I just use the default fonts, i.e. remove line 2 and 3, then use siunitx, the "mm" looks like the same font as the text.



      Can anyone help me prevent the text getting squashed like this, or suggest an alternative font that won't have this issue?



      Link:
      textbf does not work with cmvtt style



      EDIT: I edited the MWE with sisetup but was not able to fix the issue.







      fonts siunitx






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago

























      asked 4 hours ago









      slew123

      745




      745




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          One option is to turn off automatic detection of the mode, and specify siunitx to always use text mode, which will use texttt instead of mathtt (which is the squished up one).



          enter image description here



          documentclass[a4paper,openany]book

          usepackage[variablett]lmodern % line 2
          renewcommand*familydefaultttdefault % line 3
          usepackagesiunitx

          sisetup
          detect-mode=false,
          mode=text,


          begindocument

          noindent
          normal text: [SI5millimetersquared] \
          inline math mode: $[SI5millimetersquared]$ \
          mm \
          $mathttmm$

          enddocument





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "85"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451067%2fneed-help-with-font-and-siunitx-issue%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            One option is to turn off automatic detection of the mode, and specify siunitx to always use text mode, which will use texttt instead of mathtt (which is the squished up one).



            enter image description here



            documentclass[a4paper,openany]book

            usepackage[variablett]lmodern % line 2
            renewcommand*familydefaultttdefault % line 3
            usepackagesiunitx

            sisetup
            detect-mode=false,
            mode=text,


            begindocument

            noindent
            normal text: [SI5millimetersquared] \
            inline math mode: $[SI5millimetersquared]$ \
            mm \
            $mathttmm$

            enddocument





            share|improve this answer
























              up vote
              2
              down vote













              One option is to turn off automatic detection of the mode, and specify siunitx to always use text mode, which will use texttt instead of mathtt (which is the squished up one).



              enter image description here



              documentclass[a4paper,openany]book

              usepackage[variablett]lmodern % line 2
              renewcommand*familydefaultttdefault % line 3
              usepackagesiunitx

              sisetup
              detect-mode=false,
              mode=text,


              begindocument

              noindent
              normal text: [SI5millimetersquared] \
              inline math mode: $[SI5millimetersquared]$ \
              mm \
              $mathttmm$

              enddocument





              share|improve this answer






















                up vote
                2
                down vote










                up vote
                2
                down vote









                One option is to turn off automatic detection of the mode, and specify siunitx to always use text mode, which will use texttt instead of mathtt (which is the squished up one).



                enter image description here



                documentclass[a4paper,openany]book

                usepackage[variablett]lmodern % line 2
                renewcommand*familydefaultttdefault % line 3
                usepackagesiunitx

                sisetup
                detect-mode=false,
                mode=text,


                begindocument

                noindent
                normal text: [SI5millimetersquared] \
                inline math mode: $[SI5millimetersquared]$ \
                mm \
                $mathttmm$

                enddocument





                share|improve this answer












                One option is to turn off automatic detection of the mode, and specify siunitx to always use text mode, which will use texttt instead of mathtt (which is the squished up one).



                enter image description here



                documentclass[a4paper,openany]book

                usepackage[variablett]lmodern % line 2
                renewcommand*familydefaultttdefault % line 3
                usepackagesiunitx

                sisetup
                detect-mode=false,
                mode=text,


                begindocument

                noindent
                normal text: [SI5millimetersquared] \
                inline math mode: $[SI5millimetersquared]$ \
                mm \
                $mathttmm$

                enddocument






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Troy

                10.1k52164




                10.1k52164



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451067%2fneed-help-with-font-and-siunitx-issue%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    Installing NextGIS Connect into QGIS 3?

                    One-line joke