How to make double overline with less vertical displacement

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











up vote
2
down vote

favorite












overlineoverlineABC produces a double bar over ABC, but it takes up too much vertical space.



How can I make the top bar closer to the bar below it?










share|improve this question



























    up vote
    2
    down vote

    favorite












    overlineoverlineABC produces a double bar over ABC, but it takes up too much vertical space.



    How can I make the top bar closer to the bar below it?










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      overlineoverlineABC produces a double bar over ABC, but it takes up too much vertical space.



      How can I make the top bar closer to the bar below it?










      share|improve this question















      overlineoverlineABC produces a double bar over ABC, but it takes up too much vertical space.



      How can I make the top bar closer to the bar below it?







      math-mode text-decorations






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Sigur

      22k350132




      22k350132










      asked 2 hours ago









      David

      1233




      1233




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          The overline operation inserts a kern three times fontdimen8 of the math extension font (which is also used as the rule thickness).



          We can so reduce this kerning by artificially making the inner overlined box less tall by twice the applied kerning.



          documentclassarticle
          usepackageamsmath

          makeatletter
          newcommanddbloverline[1]overlinedbl@overline#1
          newcommanddbl@overline[1]mathpalettedbl@@overline#1
          newcommanddbl@@overline[2]%
          begingroup
          sboxz@$m@th#1overline#2$%
          htz@=dimexprhtz@-2dbl@adjust#1relax
          boxz@
          ifx#1scriptstylekern-scriptspaceelse
          ifx#1scriptscriptstylekern-scriptspacefifi
          endgroup

          newcommanddbl@adjust[1]%
          fontdimen8
          ifx#1displaystyletextfontelse
          ifx#1textstyletextfontelse
          ifx#1scriptstylescriptfontelse
          scriptscriptfontfififi 3

          makeatother

          begindocument

          $overlineoverlineABC$
          $dbloverlineABC$

          $X_overlineoverlineABCkern-scriptspace$
          $X_dbloverlineABC$

          enddocument


          I took the occasion for removing the scriptspace which is added in subscripts/superscripts for the inner overline atom.



          enter image description here






          share|improve this answer



























            up vote
            1
            down vote













            You can easily vary the command doverline by changing the vertical offset (e.g. 0.5ex).



            documentclassmemoir

            usepackageamsmath,tikz
            usetikzlibrarycalc

            newcommanddoverline[1]%
            tikz[baseline=(nodeAnchor.base)]
            node[inner sep=0] (nodeAnchor) $#1$;
            draw[line width=0.1ex,line cap=round]
            ($(nodeAnchor.north west)+(0.0em,0.2ex)$)
            --
            ($(nodeAnchor.north east)+(0.0em,0.2ex)$)
            ($(nodeAnchor.north west)+(0.0em,0.5ex)$)
            --
            ($(nodeAnchor.north east)+(0.0em,0.5ex)$)
            ;



            begindocument
            noindentOfficia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
            Ducimus iste excepturi et cumque ut. Earum animi autem eum tempora.
            .$overlineoverline1234567890$.
            Officia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
            Ducimus iste excepturi et cumque ut.
            .$doverline1234567890$.
            Earum animi autem eum tempora. Officia quidem est accusamus labore architecto. Ullam hic.
            beginalign*
            Z&=1234567890\
            Z&=overlineoverline1234567890\
            Z&=doverline1234567890\
            Z&=1234567890
            endalign*
            enddocument


            enter image description here




            EDIT: egreg's solution is more concise when dealing with subscripts and superscripts. My solution could be adopted to this by using LuaTeX access to mathstyle but as his solutions already deals with this issue there is not really a need for it.



            There is another solution on https://tex.stackexchange.com/a/418483/128553.






            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%2f452085%2fhow-to-make-double-overline-with-less-vertical-displacement%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              The overline operation inserts a kern three times fontdimen8 of the math extension font (which is also used as the rule thickness).



              We can so reduce this kerning by artificially making the inner overlined box less tall by twice the applied kerning.



              documentclassarticle
              usepackageamsmath

              makeatletter
              newcommanddbloverline[1]overlinedbl@overline#1
              newcommanddbl@overline[1]mathpalettedbl@@overline#1
              newcommanddbl@@overline[2]%
              begingroup
              sboxz@$m@th#1overline#2$%
              htz@=dimexprhtz@-2dbl@adjust#1relax
              boxz@
              ifx#1scriptstylekern-scriptspaceelse
              ifx#1scriptscriptstylekern-scriptspacefifi
              endgroup

              newcommanddbl@adjust[1]%
              fontdimen8
              ifx#1displaystyletextfontelse
              ifx#1textstyletextfontelse
              ifx#1scriptstylescriptfontelse
              scriptscriptfontfififi 3

              makeatother

              begindocument

              $overlineoverlineABC$
              $dbloverlineABC$

              $X_overlineoverlineABCkern-scriptspace$
              $X_dbloverlineABC$

              enddocument


              I took the occasion for removing the scriptspace which is added in subscripts/superscripts for the inner overline atom.



              enter image description here






              share|improve this answer
























                up vote
                2
                down vote













                The overline operation inserts a kern three times fontdimen8 of the math extension font (which is also used as the rule thickness).



                We can so reduce this kerning by artificially making the inner overlined box less tall by twice the applied kerning.



                documentclassarticle
                usepackageamsmath

                makeatletter
                newcommanddbloverline[1]overlinedbl@overline#1
                newcommanddbl@overline[1]mathpalettedbl@@overline#1
                newcommanddbl@@overline[2]%
                begingroup
                sboxz@$m@th#1overline#2$%
                htz@=dimexprhtz@-2dbl@adjust#1relax
                boxz@
                ifx#1scriptstylekern-scriptspaceelse
                ifx#1scriptscriptstylekern-scriptspacefifi
                endgroup

                newcommanddbl@adjust[1]%
                fontdimen8
                ifx#1displaystyletextfontelse
                ifx#1textstyletextfontelse
                ifx#1scriptstylescriptfontelse
                scriptscriptfontfififi 3

                makeatother

                begindocument

                $overlineoverlineABC$
                $dbloverlineABC$

                $X_overlineoverlineABCkern-scriptspace$
                $X_dbloverlineABC$

                enddocument


                I took the occasion for removing the scriptspace which is added in subscripts/superscripts for the inner overline atom.



                enter image description here






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  The overline operation inserts a kern three times fontdimen8 of the math extension font (which is also used as the rule thickness).



                  We can so reduce this kerning by artificially making the inner overlined box less tall by twice the applied kerning.



                  documentclassarticle
                  usepackageamsmath

                  makeatletter
                  newcommanddbloverline[1]overlinedbl@overline#1
                  newcommanddbl@overline[1]mathpalettedbl@@overline#1
                  newcommanddbl@@overline[2]%
                  begingroup
                  sboxz@$m@th#1overline#2$%
                  htz@=dimexprhtz@-2dbl@adjust#1relax
                  boxz@
                  ifx#1scriptstylekern-scriptspaceelse
                  ifx#1scriptscriptstylekern-scriptspacefifi
                  endgroup

                  newcommanddbl@adjust[1]%
                  fontdimen8
                  ifx#1displaystyletextfontelse
                  ifx#1textstyletextfontelse
                  ifx#1scriptstylescriptfontelse
                  scriptscriptfontfififi 3

                  makeatother

                  begindocument

                  $overlineoverlineABC$
                  $dbloverlineABC$

                  $X_overlineoverlineABCkern-scriptspace$
                  $X_dbloverlineABC$

                  enddocument


                  I took the occasion for removing the scriptspace which is added in subscripts/superscripts for the inner overline atom.



                  enter image description here






                  share|improve this answer












                  The overline operation inserts a kern three times fontdimen8 of the math extension font (which is also used as the rule thickness).



                  We can so reduce this kerning by artificially making the inner overlined box less tall by twice the applied kerning.



                  documentclassarticle
                  usepackageamsmath

                  makeatletter
                  newcommanddbloverline[1]overlinedbl@overline#1
                  newcommanddbl@overline[1]mathpalettedbl@@overline#1
                  newcommanddbl@@overline[2]%
                  begingroup
                  sboxz@$m@th#1overline#2$%
                  htz@=dimexprhtz@-2dbl@adjust#1relax
                  boxz@
                  ifx#1scriptstylekern-scriptspaceelse
                  ifx#1scriptscriptstylekern-scriptspacefifi
                  endgroup

                  newcommanddbl@adjust[1]%
                  fontdimen8
                  ifx#1displaystyletextfontelse
                  ifx#1textstyletextfontelse
                  ifx#1scriptstylescriptfontelse
                  scriptscriptfontfififi 3

                  makeatother

                  begindocument

                  $overlineoverlineABC$
                  $dbloverlineABC$

                  $X_overlineoverlineABCkern-scriptspace$
                  $X_dbloverlineABC$

                  enddocument


                  I took the occasion for removing the scriptspace which is added in subscripts/superscripts for the inner overline atom.



                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  egreg

                  684k8418233068




                  684k8418233068




















                      up vote
                      1
                      down vote













                      You can easily vary the command doverline by changing the vertical offset (e.g. 0.5ex).



                      documentclassmemoir

                      usepackageamsmath,tikz
                      usetikzlibrarycalc

                      newcommanddoverline[1]%
                      tikz[baseline=(nodeAnchor.base)]
                      node[inner sep=0] (nodeAnchor) $#1$;
                      draw[line width=0.1ex,line cap=round]
                      ($(nodeAnchor.north west)+(0.0em,0.2ex)$)
                      --
                      ($(nodeAnchor.north east)+(0.0em,0.2ex)$)
                      ($(nodeAnchor.north west)+(0.0em,0.5ex)$)
                      --
                      ($(nodeAnchor.north east)+(0.0em,0.5ex)$)
                      ;



                      begindocument
                      noindentOfficia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                      Ducimus iste excepturi et cumque ut. Earum animi autem eum tempora.
                      .$overlineoverline1234567890$.
                      Officia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                      Ducimus iste excepturi et cumque ut.
                      .$doverline1234567890$.
                      Earum animi autem eum tempora. Officia quidem est accusamus labore architecto. Ullam hic.
                      beginalign*
                      Z&=1234567890\
                      Z&=overlineoverline1234567890\
                      Z&=doverline1234567890\
                      Z&=1234567890
                      endalign*
                      enddocument


                      enter image description here




                      EDIT: egreg's solution is more concise when dealing with subscripts and superscripts. My solution could be adopted to this by using LuaTeX access to mathstyle but as his solutions already deals with this issue there is not really a need for it.



                      There is another solution on https://tex.stackexchange.com/a/418483/128553.






                      share|improve this answer


























                        up vote
                        1
                        down vote













                        You can easily vary the command doverline by changing the vertical offset (e.g. 0.5ex).



                        documentclassmemoir

                        usepackageamsmath,tikz
                        usetikzlibrarycalc

                        newcommanddoverline[1]%
                        tikz[baseline=(nodeAnchor.base)]
                        node[inner sep=0] (nodeAnchor) $#1$;
                        draw[line width=0.1ex,line cap=round]
                        ($(nodeAnchor.north west)+(0.0em,0.2ex)$)
                        --
                        ($(nodeAnchor.north east)+(0.0em,0.2ex)$)
                        ($(nodeAnchor.north west)+(0.0em,0.5ex)$)
                        --
                        ($(nodeAnchor.north east)+(0.0em,0.5ex)$)
                        ;



                        begindocument
                        noindentOfficia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                        Ducimus iste excepturi et cumque ut. Earum animi autem eum tempora.
                        .$overlineoverline1234567890$.
                        Officia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                        Ducimus iste excepturi et cumque ut.
                        .$doverline1234567890$.
                        Earum animi autem eum tempora. Officia quidem est accusamus labore architecto. Ullam hic.
                        beginalign*
                        Z&=1234567890\
                        Z&=overlineoverline1234567890\
                        Z&=doverline1234567890\
                        Z&=1234567890
                        endalign*
                        enddocument


                        enter image description here




                        EDIT: egreg's solution is more concise when dealing with subscripts and superscripts. My solution could be adopted to this by using LuaTeX access to mathstyle but as his solutions already deals with this issue there is not really a need for it.



                        There is another solution on https://tex.stackexchange.com/a/418483/128553.






                        share|improve this answer
























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          You can easily vary the command doverline by changing the vertical offset (e.g. 0.5ex).



                          documentclassmemoir

                          usepackageamsmath,tikz
                          usetikzlibrarycalc

                          newcommanddoverline[1]%
                          tikz[baseline=(nodeAnchor.base)]
                          node[inner sep=0] (nodeAnchor) $#1$;
                          draw[line width=0.1ex,line cap=round]
                          ($(nodeAnchor.north west)+(0.0em,0.2ex)$)
                          --
                          ($(nodeAnchor.north east)+(0.0em,0.2ex)$)
                          ($(nodeAnchor.north west)+(0.0em,0.5ex)$)
                          --
                          ($(nodeAnchor.north east)+(0.0em,0.5ex)$)
                          ;



                          begindocument
                          noindentOfficia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                          Ducimus iste excepturi et cumque ut. Earum animi autem eum tempora.
                          .$overlineoverline1234567890$.
                          Officia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                          Ducimus iste excepturi et cumque ut.
                          .$doverline1234567890$.
                          Earum animi autem eum tempora. Officia quidem est accusamus labore architecto. Ullam hic.
                          beginalign*
                          Z&=1234567890\
                          Z&=overlineoverline1234567890\
                          Z&=doverline1234567890\
                          Z&=1234567890
                          endalign*
                          enddocument


                          enter image description here




                          EDIT: egreg's solution is more concise when dealing with subscripts and superscripts. My solution could be adopted to this by using LuaTeX access to mathstyle but as his solutions already deals with this issue there is not really a need for it.



                          There is another solution on https://tex.stackexchange.com/a/418483/128553.






                          share|improve this answer














                          You can easily vary the command doverline by changing the vertical offset (e.g. 0.5ex).



                          documentclassmemoir

                          usepackageamsmath,tikz
                          usetikzlibrarycalc

                          newcommanddoverline[1]%
                          tikz[baseline=(nodeAnchor.base)]
                          node[inner sep=0] (nodeAnchor) $#1$;
                          draw[line width=0.1ex,line cap=round]
                          ($(nodeAnchor.north west)+(0.0em,0.2ex)$)
                          --
                          ($(nodeAnchor.north east)+(0.0em,0.2ex)$)
                          ($(nodeAnchor.north west)+(0.0em,0.5ex)$)
                          --
                          ($(nodeAnchor.north east)+(0.0em,0.5ex)$)
                          ;



                          begindocument
                          noindentOfficia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                          Ducimus iste excepturi et cumque ut. Earum animi autem eum tempora.
                          .$overlineoverline1234567890$.
                          Officia quidem est accusamus labore architecto. Ullam hic corporis quod consectetur sequi quod eaque.
                          Ducimus iste excepturi et cumque ut.
                          .$doverline1234567890$.
                          Earum animi autem eum tempora. Officia quidem est accusamus labore architecto. Ullam hic.
                          beginalign*
                          Z&=1234567890\
                          Z&=overlineoverline1234567890\
                          Z&=doverline1234567890\
                          Z&=1234567890
                          endalign*
                          enddocument


                          enter image description here




                          EDIT: egreg's solution is more concise when dealing with subscripts and superscripts. My solution could be adopted to this by using LuaTeX access to mathstyle but as his solutions already deals with this issue there is not really a need for it.



                          There is another solution on https://tex.stackexchange.com/a/418483/128553.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 31 mins ago

























                          answered 1 hour ago









                          CampanIgnis

                          1,8662628




                          1,8662628



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452085%2fhow-to-make-double-overline-with-less-vertical-displacement%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              What does second last employer means? [closed]

                              One-line joke