Different font for numbers in URLs [duplicate]











up vote
1
down vote

favorite













This question already has an answer here:




  • Problem with digits in URLs when using mathspec and hyperref

    1 answer




I am using mathspec to make the fonts in math mode match the roman fonts used in my text body. The “digits” environment in mathspec takes effect for all digits in the document. This means that digits that would normally use a font other than roman, such as those within URLs, also end up using this font, despite loading the mathspec command setallmonofonts (which I had assumed would override setmathfont).



documentclass{article}

usepackage{mathspec}
setmainfont{Book Antiqua}
setmathfont(Digits,Latin){Book Antiqua}
setallmonofonts{Courier New}

usepackage[hidelinks]{hyperref}

begin{document}
Some text. Some figures: 123456789\
url{http://some.urlwithnumbers/123456789}

$$Some text in math mode. Some figures in math mode: 12345789$$

end{document}


image of xelatex output



Is there a way of setting the font for only the digits that occur in math mode? I would like to keep my specified monospace font for digits within monospaced strings (and likewise with sans serif fonts, should I need to use them).










share|improve this question













marked as duplicate by Stefan Pinnow, Kurt, Community Dec 3 at 17:23


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















    up vote
    1
    down vote

    favorite













    This question already has an answer here:




    • Problem with digits in URLs when using mathspec and hyperref

      1 answer




    I am using mathspec to make the fonts in math mode match the roman fonts used in my text body. The “digits” environment in mathspec takes effect for all digits in the document. This means that digits that would normally use a font other than roman, such as those within URLs, also end up using this font, despite loading the mathspec command setallmonofonts (which I had assumed would override setmathfont).



    documentclass{article}

    usepackage{mathspec}
    setmainfont{Book Antiqua}
    setmathfont(Digits,Latin){Book Antiqua}
    setallmonofonts{Courier New}

    usepackage[hidelinks]{hyperref}

    begin{document}
    Some text. Some figures: 123456789\
    url{http://some.urlwithnumbers/123456789}

    $$Some text in math mode. Some figures in math mode: 12345789$$

    end{document}


    image of xelatex output



    Is there a way of setting the font for only the digits that occur in math mode? I would like to keep my specified monospace font for digits within monospaced strings (and likewise with sans serif fonts, should I need to use them).










    share|improve this question













    marked as duplicate by Stefan Pinnow, Kurt, Community Dec 3 at 17:23


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite












      This question already has an answer here:




      • Problem with digits in URLs when using mathspec and hyperref

        1 answer




      I am using mathspec to make the fonts in math mode match the roman fonts used in my text body. The “digits” environment in mathspec takes effect for all digits in the document. This means that digits that would normally use a font other than roman, such as those within URLs, also end up using this font, despite loading the mathspec command setallmonofonts (which I had assumed would override setmathfont).



      documentclass{article}

      usepackage{mathspec}
      setmainfont{Book Antiqua}
      setmathfont(Digits,Latin){Book Antiqua}
      setallmonofonts{Courier New}

      usepackage[hidelinks]{hyperref}

      begin{document}
      Some text. Some figures: 123456789\
      url{http://some.urlwithnumbers/123456789}

      $$Some text in math mode. Some figures in math mode: 12345789$$

      end{document}


      image of xelatex output



      Is there a way of setting the font for only the digits that occur in math mode? I would like to keep my specified monospace font for digits within monospaced strings (and likewise with sans serif fonts, should I need to use them).










      share|improve this question














      This question already has an answer here:




      • Problem with digits in URLs when using mathspec and hyperref

        1 answer




      I am using mathspec to make the fonts in math mode match the roman fonts used in my text body. The “digits” environment in mathspec takes effect for all digits in the document. This means that digits that would normally use a font other than roman, such as those within URLs, also end up using this font, despite loading the mathspec command setallmonofonts (which I had assumed would override setmathfont).



      documentclass{article}

      usepackage{mathspec}
      setmainfont{Book Antiqua}
      setmathfont(Digits,Latin){Book Antiqua}
      setallmonofonts{Courier New}

      usepackage[hidelinks]{hyperref}

      begin{document}
      Some text. Some figures: 123456789\
      url{http://some.urlwithnumbers/123456789}

      $$Some text in math mode. Some figures in math mode: 12345789$$

      end{document}


      image of xelatex output



      Is there a way of setting the font for only the digits that occur in math mode? I would like to keep my specified monospace font for digits within monospaced strings (and likewise with sans serif fonts, should I need to use them).





      This question already has an answer here:




      • Problem with digits in URLs when using mathspec and hyperref

        1 answer








      xetex fontspec mathspec






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 3 at 16:19









      user176042

      84




      84




      marked as duplicate by Stefan Pinnow, Kurt, Community Dec 3 at 17:23


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by Stefan Pinnow, Kurt, Community Dec 3 at 17:23


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The trick from https://tex.stackexchange.com/a/99774 seems to work:



          documentclass{article}

          usepackage{mathspec}
          setmainfont{Arial}
          setmathfont(Digits,Latin){Arial}
          setallmonofonts{Courier New}

          makeatletter
          DeclareMathSymbol{0}{mathalpha}{eu@DigitsArabic@symfont}{`0}
          DeclareMathSymbol{1}{mathalpha}{eu@DigitsArabic@symfont}{`1}
          DeclareMathSymbol{2}{mathalpha}{eu@DigitsArabic@symfont}{`2}
          DeclareMathSymbol{3}{mathalpha}{eu@DigitsArabic@symfont}{`3}
          DeclareMathSymbol{4}{mathalpha}{eu@DigitsArabic@symfont}{`4}
          DeclareMathSymbol{5}{mathalpha}{eu@DigitsArabic@symfont}{`5}
          DeclareMathSymbol{6}{mathalpha}{eu@DigitsArabic@symfont}{`6}
          DeclareMathSymbol{7}{mathalpha}{eu@DigitsArabic@symfont}{`7}
          DeclareMathSymbol{8}{mathalpha}{eu@DigitsArabic@symfont}{`8}
          DeclareMathSymbol{9}{mathalpha}{eu@DigitsArabic@symfont}{`9}
          makeatother



          usepackage[hidelinks]{hyperref}

          begin{document}
          Some text. Some figures: 123456789\
          url{http://some.urlwithnumbers/123456789}

          [Some text in math mode. Some figures in math mode: 12345789]

          end{document}


          enter image description here






          share|improve this answer




























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            The trick from https://tex.stackexchange.com/a/99774 seems to work:



            documentclass{article}

            usepackage{mathspec}
            setmainfont{Arial}
            setmathfont(Digits,Latin){Arial}
            setallmonofonts{Courier New}

            makeatletter
            DeclareMathSymbol{0}{mathalpha}{eu@DigitsArabic@symfont}{`0}
            DeclareMathSymbol{1}{mathalpha}{eu@DigitsArabic@symfont}{`1}
            DeclareMathSymbol{2}{mathalpha}{eu@DigitsArabic@symfont}{`2}
            DeclareMathSymbol{3}{mathalpha}{eu@DigitsArabic@symfont}{`3}
            DeclareMathSymbol{4}{mathalpha}{eu@DigitsArabic@symfont}{`4}
            DeclareMathSymbol{5}{mathalpha}{eu@DigitsArabic@symfont}{`5}
            DeclareMathSymbol{6}{mathalpha}{eu@DigitsArabic@symfont}{`6}
            DeclareMathSymbol{7}{mathalpha}{eu@DigitsArabic@symfont}{`7}
            DeclareMathSymbol{8}{mathalpha}{eu@DigitsArabic@symfont}{`8}
            DeclareMathSymbol{9}{mathalpha}{eu@DigitsArabic@symfont}{`9}
            makeatother



            usepackage[hidelinks]{hyperref}

            begin{document}
            Some text. Some figures: 123456789\
            url{http://some.urlwithnumbers/123456789}

            [Some text in math mode. Some figures in math mode: 12345789]

            end{document}


            enter image description here






            share|improve this answer

























              up vote
              1
              down vote



              accepted










              The trick from https://tex.stackexchange.com/a/99774 seems to work:



              documentclass{article}

              usepackage{mathspec}
              setmainfont{Arial}
              setmathfont(Digits,Latin){Arial}
              setallmonofonts{Courier New}

              makeatletter
              DeclareMathSymbol{0}{mathalpha}{eu@DigitsArabic@symfont}{`0}
              DeclareMathSymbol{1}{mathalpha}{eu@DigitsArabic@symfont}{`1}
              DeclareMathSymbol{2}{mathalpha}{eu@DigitsArabic@symfont}{`2}
              DeclareMathSymbol{3}{mathalpha}{eu@DigitsArabic@symfont}{`3}
              DeclareMathSymbol{4}{mathalpha}{eu@DigitsArabic@symfont}{`4}
              DeclareMathSymbol{5}{mathalpha}{eu@DigitsArabic@symfont}{`5}
              DeclareMathSymbol{6}{mathalpha}{eu@DigitsArabic@symfont}{`6}
              DeclareMathSymbol{7}{mathalpha}{eu@DigitsArabic@symfont}{`7}
              DeclareMathSymbol{8}{mathalpha}{eu@DigitsArabic@symfont}{`8}
              DeclareMathSymbol{9}{mathalpha}{eu@DigitsArabic@symfont}{`9}
              makeatother



              usepackage[hidelinks]{hyperref}

              begin{document}
              Some text. Some figures: 123456789\
              url{http://some.urlwithnumbers/123456789}

              [Some text in math mode. Some figures in math mode: 12345789]

              end{document}


              enter image description here






              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                The trick from https://tex.stackexchange.com/a/99774 seems to work:



                documentclass{article}

                usepackage{mathspec}
                setmainfont{Arial}
                setmathfont(Digits,Latin){Arial}
                setallmonofonts{Courier New}

                makeatletter
                DeclareMathSymbol{0}{mathalpha}{eu@DigitsArabic@symfont}{`0}
                DeclareMathSymbol{1}{mathalpha}{eu@DigitsArabic@symfont}{`1}
                DeclareMathSymbol{2}{mathalpha}{eu@DigitsArabic@symfont}{`2}
                DeclareMathSymbol{3}{mathalpha}{eu@DigitsArabic@symfont}{`3}
                DeclareMathSymbol{4}{mathalpha}{eu@DigitsArabic@symfont}{`4}
                DeclareMathSymbol{5}{mathalpha}{eu@DigitsArabic@symfont}{`5}
                DeclareMathSymbol{6}{mathalpha}{eu@DigitsArabic@symfont}{`6}
                DeclareMathSymbol{7}{mathalpha}{eu@DigitsArabic@symfont}{`7}
                DeclareMathSymbol{8}{mathalpha}{eu@DigitsArabic@symfont}{`8}
                DeclareMathSymbol{9}{mathalpha}{eu@DigitsArabic@symfont}{`9}
                makeatother



                usepackage[hidelinks]{hyperref}

                begin{document}
                Some text. Some figures: 123456789\
                url{http://some.urlwithnumbers/123456789}

                [Some text in math mode. Some figures in math mode: 12345789]

                end{document}


                enter image description here






                share|improve this answer












                The trick from https://tex.stackexchange.com/a/99774 seems to work:



                documentclass{article}

                usepackage{mathspec}
                setmainfont{Arial}
                setmathfont(Digits,Latin){Arial}
                setallmonofonts{Courier New}

                makeatletter
                DeclareMathSymbol{0}{mathalpha}{eu@DigitsArabic@symfont}{`0}
                DeclareMathSymbol{1}{mathalpha}{eu@DigitsArabic@symfont}{`1}
                DeclareMathSymbol{2}{mathalpha}{eu@DigitsArabic@symfont}{`2}
                DeclareMathSymbol{3}{mathalpha}{eu@DigitsArabic@symfont}{`3}
                DeclareMathSymbol{4}{mathalpha}{eu@DigitsArabic@symfont}{`4}
                DeclareMathSymbol{5}{mathalpha}{eu@DigitsArabic@symfont}{`5}
                DeclareMathSymbol{6}{mathalpha}{eu@DigitsArabic@symfont}{`6}
                DeclareMathSymbol{7}{mathalpha}{eu@DigitsArabic@symfont}{`7}
                DeclareMathSymbol{8}{mathalpha}{eu@DigitsArabic@symfont}{`8}
                DeclareMathSymbol{9}{mathalpha}{eu@DigitsArabic@symfont}{`9}
                makeatother



                usepackage[hidelinks]{hyperref}

                begin{document}
                Some text. Some figures: 123456789\
                url{http://some.urlwithnumbers/123456789}

                [Some text in math mode. Some figures in math mode: 12345789]

                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 3 at 16:37









                user176037

                1009




                1009















                    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?