Fractions with characters that don't have descenders or ascenders

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












2















The default vertical spacing for fractions accommodates the possibility of a character with a descender or an ascender (or the possibility of subscripts/superscripts). This is, for the most part, the desirable functionality. For example, in the code below,



$$fracga=fracac=fracab$$


nothing needs to be changed. However, there is occasion where an expression like the ones below



$$fracac$$
$$fracab$$
$$fracba$$


occurs in isolation where a reduction in the vertical space on either side, or both, seems warranted to balance the fraction.




If I'm going on a final pass through a document, what would be the best approach to remove this vertical space that would be compatible with a change of font?











share|improve this question






















  • Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

    – Skillmon
    Jan 21 at 20:21






  • 1





    See Why is [ ... ] preferable to $$ ... $$?

    – Werner
    Jan 21 at 21:04











  • @Werner I excluded amsmath on purpose.

    – Robert Wolfe
    Jan 21 at 21:44















2















The default vertical spacing for fractions accommodates the possibility of a character with a descender or an ascender (or the possibility of subscripts/superscripts). This is, for the most part, the desirable functionality. For example, in the code below,



$$fracga=fracac=fracab$$


nothing needs to be changed. However, there is occasion where an expression like the ones below



$$fracac$$
$$fracab$$
$$fracba$$


occurs in isolation where a reduction in the vertical space on either side, or both, seems warranted to balance the fraction.




If I'm going on a final pass through a document, what would be the best approach to remove this vertical space that would be compatible with a change of font?











share|improve this question






















  • Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

    – Skillmon
    Jan 21 at 20:21






  • 1





    See Why is [ ... ] preferable to $$ ... $$?

    – Werner
    Jan 21 at 21:04











  • @Werner I excluded amsmath on purpose.

    – Robert Wolfe
    Jan 21 at 21:44













2












2








2








The default vertical spacing for fractions accommodates the possibility of a character with a descender or an ascender (or the possibility of subscripts/superscripts). This is, for the most part, the desirable functionality. For example, in the code below,



$$fracga=fracac=fracab$$


nothing needs to be changed. However, there is occasion where an expression like the ones below



$$fracac$$
$$fracab$$
$$fracba$$


occurs in isolation where a reduction in the vertical space on either side, or both, seems warranted to balance the fraction.




If I'm going on a final pass through a document, what would be the best approach to remove this vertical space that would be compatible with a change of font?











share|improve this question














The default vertical spacing for fractions accommodates the possibility of a character with a descender or an ascender (or the possibility of subscripts/superscripts). This is, for the most part, the desirable functionality. For example, in the code below,



$$fracga=fracac=fracab$$


nothing needs to be changed. However, there is occasion where an expression like the ones below



$$fracac$$
$$fracab$$
$$fracba$$


occurs in isolation where a reduction in the vertical space on either side, or both, seems warranted to balance the fraction.




If I'm going on a final pass through a document, what would be the best approach to remove this vertical space that would be compatible with a change of font?








math-mode spacing






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 21 at 20:06









Robert WolfeRobert Wolfe

14110




14110












  • Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

    – Skillmon
    Jan 21 at 20:21






  • 1





    See Why is [ ... ] preferable to $$ ... $$?

    – Werner
    Jan 21 at 21:04











  • @Werner I excluded amsmath on purpose.

    – Robert Wolfe
    Jan 21 at 21:44

















  • Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

    – Skillmon
    Jan 21 at 20:21






  • 1





    See Why is [ ... ] preferable to $$ ... $$?

    – Werner
    Jan 21 at 21:04











  • @Werner I excluded amsmath on purpose.

    – Robert Wolfe
    Jan 21 at 21:44
















Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

– Skillmon
Jan 21 at 20:21





Apart from don't: you write your own macro that typesets numerator and denominator inside boxes and measures it, then draw your own version of a fraction that only uses those sizes and no strut or similar.

– Skillmon
Jan 21 at 20:21




1




1





See Why is [ ... ] preferable to $$ ... $$?

– Werner
Jan 21 at 21:04





See Why is [ ... ] preferable to $$ ... $$?

– Werner
Jan 21 at 21:04













@Werner I excluded amsmath on purpose.

– Robert Wolfe
Jan 21 at 21:44





@Werner I excluded amsmath on purpose.

– Robert Wolfe
Jan 21 at 21:44










2 Answers
2






active

oldest

votes


















4














I'm not sure it's a good idea. Anyhow, here's an implementation that should only be used in displays (fractions in text style or lower are already adjusted).



documentclassarticle
usepackageamsmath

newcommandafrac[2]%
dfracadjustbot#1
adjusttop#2%


makeatletter
newcommandadjustbot[1]%
begingroup
settodepthdimen@$textstyle y$%
raiseboxdimexprdepth-dimen@$m@thtextstyle#1$%
endgroup

newcommandadjusttop[1]%
begingroup
settoheightdimen@$textstyle l$%
raiseboxdimexprdimen@-height$m@thtextstyle#1$%
endgroup

makeatother

begindocument

[
fracabafracabquad
fracacafracacquad
fracbaafracbaquad
fracgaafracga
]
enddocument


enter image description here






share|improve this answer






























    2














    documentclassarticle
    newcommandmyfrac[2]
    fracraisebox-.4ex$#1$raisebox.4ex$#2$
    begindocument
    $$fracpd=myfracac$$
    $$fracpd=myfracab$$
    $$fracpd=myfracba$$
    enddocument


    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%2f471195%2ffractions-with-characters-that-dont-have-descenders-or-ascenders%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      I'm not sure it's a good idea. Anyhow, here's an implementation that should only be used in displays (fractions in text style or lower are already adjusted).



      documentclassarticle
      usepackageamsmath

      newcommandafrac[2]%
      dfracadjustbot#1
      adjusttop#2%


      makeatletter
      newcommandadjustbot[1]%
      begingroup
      settodepthdimen@$textstyle y$%
      raiseboxdimexprdepth-dimen@$m@thtextstyle#1$%
      endgroup

      newcommandadjusttop[1]%
      begingroup
      settoheightdimen@$textstyle l$%
      raiseboxdimexprdimen@-height$m@thtextstyle#1$%
      endgroup

      makeatother

      begindocument

      [
      fracabafracabquad
      fracacafracacquad
      fracbaafracbaquad
      fracgaafracga
      ]
      enddocument


      enter image description here






      share|improve this answer



























        4














        I'm not sure it's a good idea. Anyhow, here's an implementation that should only be used in displays (fractions in text style or lower are already adjusted).



        documentclassarticle
        usepackageamsmath

        newcommandafrac[2]%
        dfracadjustbot#1
        adjusttop#2%


        makeatletter
        newcommandadjustbot[1]%
        begingroup
        settodepthdimen@$textstyle y$%
        raiseboxdimexprdepth-dimen@$m@thtextstyle#1$%
        endgroup

        newcommandadjusttop[1]%
        begingroup
        settoheightdimen@$textstyle l$%
        raiseboxdimexprdimen@-height$m@thtextstyle#1$%
        endgroup

        makeatother

        begindocument

        [
        fracabafracabquad
        fracacafracacquad
        fracbaafracbaquad
        fracgaafracga
        ]
        enddocument


        enter image description here






        share|improve this answer

























          4












          4








          4







          I'm not sure it's a good idea. Anyhow, here's an implementation that should only be used in displays (fractions in text style or lower are already adjusted).



          documentclassarticle
          usepackageamsmath

          newcommandafrac[2]%
          dfracadjustbot#1
          adjusttop#2%


          makeatletter
          newcommandadjustbot[1]%
          begingroup
          settodepthdimen@$textstyle y$%
          raiseboxdimexprdepth-dimen@$m@thtextstyle#1$%
          endgroup

          newcommandadjusttop[1]%
          begingroup
          settoheightdimen@$textstyle l$%
          raiseboxdimexprdimen@-height$m@thtextstyle#1$%
          endgroup

          makeatother

          begindocument

          [
          fracabafracabquad
          fracacafracacquad
          fracbaafracbaquad
          fracgaafracga
          ]
          enddocument


          enter image description here






          share|improve this answer













          I'm not sure it's a good idea. Anyhow, here's an implementation that should only be used in displays (fractions in text style or lower are already adjusted).



          documentclassarticle
          usepackageamsmath

          newcommandafrac[2]%
          dfracadjustbot#1
          adjusttop#2%


          makeatletter
          newcommandadjustbot[1]%
          begingroup
          settodepthdimen@$textstyle y$%
          raiseboxdimexprdepth-dimen@$m@thtextstyle#1$%
          endgroup

          newcommandadjusttop[1]%
          begingroup
          settoheightdimen@$textstyle l$%
          raiseboxdimexprdimen@-height$m@thtextstyle#1$%
          endgroup

          makeatother

          begindocument

          [
          fracabafracabquad
          fracacafracacquad
          fracbaafracbaquad
          fracgaafracga
          ]
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 21 at 21:52









          egregegreg

          718k8719043200




          718k8719043200





















              2














              documentclassarticle
              newcommandmyfrac[2]
              fracraisebox-.4ex$#1$raisebox.4ex$#2$
              begindocument
              $$fracpd=myfracac$$
              $$fracpd=myfracab$$
              $$fracpd=myfracba$$
              enddocument


              enter image description here






              share|improve this answer



























                2














                documentclassarticle
                newcommandmyfrac[2]
                fracraisebox-.4ex$#1$raisebox.4ex$#2$
                begindocument
                $$fracpd=myfracac$$
                $$fracpd=myfracab$$
                $$fracpd=myfracba$$
                enddocument


                enter image description here






                share|improve this answer

























                  2












                  2








                  2







                  documentclassarticle
                  newcommandmyfrac[2]
                  fracraisebox-.4ex$#1$raisebox.4ex$#2$
                  begindocument
                  $$fracpd=myfracac$$
                  $$fracpd=myfracab$$
                  $$fracpd=myfracba$$
                  enddocument


                  enter image description here






                  share|improve this answer













                  documentclassarticle
                  newcommandmyfrac[2]
                  fracraisebox-.4ex$#1$raisebox.4ex$#2$
                  begindocument
                  $$fracpd=myfracac$$
                  $$fracpd=myfracab$$
                  $$fracpd=myfracba$$
                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 21 at 20:52







                  user4686


































                      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%2f471195%2ffractions-with-characters-that-dont-have-descenders-or-ascenders%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 check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?