How to write a character overlapping another character

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












4















How can I write two characters in the same place?



In particular, I want to write an arrow $rightarrow$, and then write a letter such that the arrow strikes through the letter. I found some similar questions (Range symbol over character, Substitute a character by another one (Lualatex), etc.) but they are not exactly the same question.










share|improve this question



















  • 5





    Since an arrow is wider than almost every character, what do you plan to do with the excess?

    – egreg
    Feb 19 at 13:45











  • A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

    – Martin Scharrer
    Feb 19 at 14:45















4















How can I write two characters in the same place?



In particular, I want to write an arrow $rightarrow$, and then write a letter such that the arrow strikes through the letter. I found some similar questions (Range symbol over character, Substitute a character by another one (Lualatex), etc.) but they are not exactly the same question.










share|improve this question



















  • 5





    Since an arrow is wider than almost every character, what do you plan to do with the excess?

    – egreg
    Feb 19 at 13:45











  • A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

    – Martin Scharrer
    Feb 19 at 14:45













4












4








4








How can I write two characters in the same place?



In particular, I want to write an arrow $rightarrow$, and then write a letter such that the arrow strikes through the letter. I found some similar questions (Range symbol over character, Substitute a character by another one (Lualatex), etc.) but they are not exactly the same question.










share|improve this question
















How can I write two characters in the same place?



In particular, I want to write an arrow $rightarrow$, and then write a letter such that the arrow strikes through the letter. I found some similar questions (Range symbol over character, Substitute a character by another one (Lualatex), etc.) but they are not exactly the same question.







symbols






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 19 at 19:22







Erel Segal-Halevi

















asked Feb 19 at 13:26









Erel Segal-HaleviErel Segal-Halevi

2,45462342




2,45462342







  • 5





    Since an arrow is wider than almost every character, what do you plan to do with the excess?

    – egreg
    Feb 19 at 13:45











  • A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

    – Martin Scharrer
    Feb 19 at 14:45












  • 5





    Since an arrow is wider than almost every character, what do you plan to do with the excess?

    – egreg
    Feb 19 at 13:45











  • A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

    – Martin Scharrer
    Feb 19 at 14:45







5




5





Since an arrow is wider than almost every character, what do you plan to do with the excess?

– egreg
Feb 19 at 13:45





Since an arrow is wider than almost every character, what do you plan to do with the excess?

– egreg
Feb 19 at 13:45













A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

– Martin Scharrer
Feb 19 at 14:45





A simple but probably naive way is rlap$rightarrow$x. Like egreg wrote, you need to figure out which way the excess should go. Note that the adjustbox package give further ways to lap content to all directions.

– Martin Scharrer
Feb 19 at 14:45










4 Answers
4






active

oldest

votes


















12














Not clear if you want it in text or math...



documentclassarticle
usepackagestackengine
begindocument
In testackengine0ptx$rightarrow$OcFTLt...

$ensurestackMathstackengine0ptyrightarrowOcFTL = mx + b$
enddocument


enter image description here



Also, it is not clear if you want the arrow's width to be accounted for:



documentclassarticle
usepackagestackengine
begindocument
In testackengine0ptx$rightarrow$OcFFLt...

$ensurestackMathstackengine0ptyrightarrow!OcFFL = mx + b$
enddocument


enter image description here



Other things that can be easily adjusted above include horizontal alignment (currently centered) as well as vertical height of arrow placement (currently placed at its natural height).



Once the specifics are decided on the use case, this can be easily encapsulated in a macro.



Below, keeping up with the egregs, I implement a macro version (overarrow) for math that preserves the math style:



documentclassarticle
usepackagestackengine,scalerel
newcommandoverarrow[1]ThisStyleensurestackMath%
stackengine0ptSavedStyle#1SavedStylerightarrow!OcFFL
begindocument
$overarrowy = mx_overarrowz + b$
enddocument


enter image description here






share|improve this answer
































    9














    A simple makebox[0pt].. can achieve this. Depending on your real use case, this may require a bit of tuning.



    documentclass[12pt,a4paper]article 
    begindocument

    $makebox[0pt][l]$rightarrow$A$

    enddocument


    enter image description here






    share|improve this answer






























      7














      Here's for text in two versions:



      documentclassarticle

      DeclareRobustCommandasA[1]% arrow strike
      leavevmodebegingroup
      vphantom#1%
      ooalignhidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr%
      endgroup

      DeclareRobustCommandasB[1]% arrow strike
      leavevmodebegingroup
      vphantom#1%
      ooalign$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr%
      endgroup


      begindocument

      stasAruck

      stasBruck

      enddocument


      enter image description here



      For math:



      documentclassarticle

      makeatletter
      DeclareRobustCommandas[1]% arrow strike
      vphantom#1mathpaletteerel@as#1%


      newcommanderel@as[2]%
      ooalignhfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr%

      makeatother

      begindocument

      $a+asb+c_asx$

      enddocument


      enter image description here






      share|improve this answer






























        4














        In case you want a bit of flexibility and the arrow to adjust to the width of the stuff it is running through, you may want to use tikzmark.



        documentclassarticle
        usepackagetikz
        usetikzlibrarytikzmark
        newcounteratm
        newcommandarrowthrough[2]stepcounteratmtikzmarknode[path picture=
        draw[->,#1] (path picture bounding box.west) --
        (path picture bounding box.east);]atm-theatm#2
        begindocument
        arrowthroughx
        [ E=arrowthroughmc^2]
        arrowthrough[red,-latex]Hello arrowthrough[latex-,thick,blue]World!
        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%2f475653%2fhow-to-write-a-character-overlapping-another-character%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          12














          Not clear if you want it in text or math...



          documentclassarticle
          usepackagestackengine
          begindocument
          In testackengine0ptx$rightarrow$OcFTLt...

          $ensurestackMathstackengine0ptyrightarrowOcFTL = mx + b$
          enddocument


          enter image description here



          Also, it is not clear if you want the arrow's width to be accounted for:



          documentclassarticle
          usepackagestackengine
          begindocument
          In testackengine0ptx$rightarrow$OcFFLt...

          $ensurestackMathstackengine0ptyrightarrow!OcFFL = mx + b$
          enddocument


          enter image description here



          Other things that can be easily adjusted above include horizontal alignment (currently centered) as well as vertical height of arrow placement (currently placed at its natural height).



          Once the specifics are decided on the use case, this can be easily encapsulated in a macro.



          Below, keeping up with the egregs, I implement a macro version (overarrow) for math that preserves the math style:



          documentclassarticle
          usepackagestackengine,scalerel
          newcommandoverarrow[1]ThisStyleensurestackMath%
          stackengine0ptSavedStyle#1SavedStylerightarrow!OcFFL
          begindocument
          $overarrowy = mx_overarrowz + b$
          enddocument


          enter image description here






          share|improve this answer





























            12














            Not clear if you want it in text or math...



            documentclassarticle
            usepackagestackengine
            begindocument
            In testackengine0ptx$rightarrow$OcFTLt...

            $ensurestackMathstackengine0ptyrightarrowOcFTL = mx + b$
            enddocument


            enter image description here



            Also, it is not clear if you want the arrow's width to be accounted for:



            documentclassarticle
            usepackagestackengine
            begindocument
            In testackengine0ptx$rightarrow$OcFFLt...

            $ensurestackMathstackengine0ptyrightarrow!OcFFL = mx + b$
            enddocument


            enter image description here



            Other things that can be easily adjusted above include horizontal alignment (currently centered) as well as vertical height of arrow placement (currently placed at its natural height).



            Once the specifics are decided on the use case, this can be easily encapsulated in a macro.



            Below, keeping up with the egregs, I implement a macro version (overarrow) for math that preserves the math style:



            documentclassarticle
            usepackagestackengine,scalerel
            newcommandoverarrow[1]ThisStyleensurestackMath%
            stackengine0ptSavedStyle#1SavedStylerightarrow!OcFFL
            begindocument
            $overarrowy = mx_overarrowz + b$
            enddocument


            enter image description here






            share|improve this answer



























              12












              12








              12







              Not clear if you want it in text or math...



              documentclassarticle
              usepackagestackengine
              begindocument
              In testackengine0ptx$rightarrow$OcFTLt...

              $ensurestackMathstackengine0ptyrightarrowOcFTL = mx + b$
              enddocument


              enter image description here



              Also, it is not clear if you want the arrow's width to be accounted for:



              documentclassarticle
              usepackagestackengine
              begindocument
              In testackengine0ptx$rightarrow$OcFFLt...

              $ensurestackMathstackengine0ptyrightarrow!OcFFL = mx + b$
              enddocument


              enter image description here



              Other things that can be easily adjusted above include horizontal alignment (currently centered) as well as vertical height of arrow placement (currently placed at its natural height).



              Once the specifics are decided on the use case, this can be easily encapsulated in a macro.



              Below, keeping up with the egregs, I implement a macro version (overarrow) for math that preserves the math style:



              documentclassarticle
              usepackagestackengine,scalerel
              newcommandoverarrow[1]ThisStyleensurestackMath%
              stackengine0ptSavedStyle#1SavedStylerightarrow!OcFFL
              begindocument
              $overarrowy = mx_overarrowz + b$
              enddocument


              enter image description here






              share|improve this answer















              Not clear if you want it in text or math...



              documentclassarticle
              usepackagestackengine
              begindocument
              In testackengine0ptx$rightarrow$OcFTLt...

              $ensurestackMathstackengine0ptyrightarrowOcFTL = mx + b$
              enddocument


              enter image description here



              Also, it is not clear if you want the arrow's width to be accounted for:



              documentclassarticle
              usepackagestackengine
              begindocument
              In testackengine0ptx$rightarrow$OcFFLt...

              $ensurestackMathstackengine0ptyrightarrow!OcFFL = mx + b$
              enddocument


              enter image description here



              Other things that can be easily adjusted above include horizontal alignment (currently centered) as well as vertical height of arrow placement (currently placed at its natural height).



              Once the specifics are decided on the use case, this can be easily encapsulated in a macro.



              Below, keeping up with the egregs, I implement a macro version (overarrow) for math that preserves the math style:



              documentclassarticle
              usepackagestackengine,scalerel
              newcommandoverarrow[1]ThisStyleensurestackMath%
              stackengine0ptSavedStyle#1SavedStylerightarrow!OcFFL
              begindocument
              $overarrowy = mx_overarrowz + b$
              enddocument


              enter image description here







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Feb 19 at 14:12

























              answered Feb 19 at 13:35









              Steven B. SegletesSteven B. Segletes

              158k9204411




              158k9204411





















                  9














                  A simple makebox[0pt].. can achieve this. Depending on your real use case, this may require a bit of tuning.



                  documentclass[12pt,a4paper]article 
                  begindocument

                  $makebox[0pt][l]$rightarrow$A$

                  enddocument


                  enter image description here






                  share|improve this answer



























                    9














                    A simple makebox[0pt].. can achieve this. Depending on your real use case, this may require a bit of tuning.



                    documentclass[12pt,a4paper]article 
                    begindocument

                    $makebox[0pt][l]$rightarrow$A$

                    enddocument


                    enter image description here






                    share|improve this answer

























                      9












                      9








                      9







                      A simple makebox[0pt].. can achieve this. Depending on your real use case, this may require a bit of tuning.



                      documentclass[12pt,a4paper]article 
                      begindocument

                      $makebox[0pt][l]$rightarrow$A$

                      enddocument


                      enter image description here






                      share|improve this answer













                      A simple makebox[0pt].. can achieve this. Depending on your real use case, this may require a bit of tuning.



                      documentclass[12pt,a4paper]article 
                      begindocument

                      $makebox[0pt][l]$rightarrow$A$

                      enddocument


                      enter image description here







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Feb 19 at 13:40









                      AboAmmarAboAmmar

                      34.4k32985




                      34.4k32985





















                          7














                          Here's for text in two versions:



                          documentclassarticle

                          DeclareRobustCommandasA[1]% arrow strike
                          leavevmodebegingroup
                          vphantom#1%
                          ooalignhidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr%
                          endgroup

                          DeclareRobustCommandasB[1]% arrow strike
                          leavevmodebegingroup
                          vphantom#1%
                          ooalign$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr%
                          endgroup


                          begindocument

                          stasAruck

                          stasBruck

                          enddocument


                          enter image description here



                          For math:



                          documentclassarticle

                          makeatletter
                          DeclareRobustCommandas[1]% arrow strike
                          vphantom#1mathpaletteerel@as#1%


                          newcommanderel@as[2]%
                          ooalignhfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr%

                          makeatother

                          begindocument

                          $a+asb+c_asx$

                          enddocument


                          enter image description here






                          share|improve this answer



























                            7














                            Here's for text in two versions:



                            documentclassarticle

                            DeclareRobustCommandasA[1]% arrow strike
                            leavevmodebegingroup
                            vphantom#1%
                            ooalignhidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr%
                            endgroup

                            DeclareRobustCommandasB[1]% arrow strike
                            leavevmodebegingroup
                            vphantom#1%
                            ooalign$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr%
                            endgroup


                            begindocument

                            stasAruck

                            stasBruck

                            enddocument


                            enter image description here



                            For math:



                            documentclassarticle

                            makeatletter
                            DeclareRobustCommandas[1]% arrow strike
                            vphantom#1mathpaletteerel@as#1%


                            newcommanderel@as[2]%
                            ooalignhfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr%

                            makeatother

                            begindocument

                            $a+asb+c_asx$

                            enddocument


                            enter image description here






                            share|improve this answer

























                              7












                              7








                              7







                              Here's for text in two versions:



                              documentclassarticle

                              DeclareRobustCommandasA[1]% arrow strike
                              leavevmodebegingroup
                              vphantom#1%
                              ooalignhidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr%
                              endgroup

                              DeclareRobustCommandasB[1]% arrow strike
                              leavevmodebegingroup
                              vphantom#1%
                              ooalign$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr%
                              endgroup


                              begindocument

                              stasAruck

                              stasBruck

                              enddocument


                              enter image description here



                              For math:



                              documentclassarticle

                              makeatletter
                              DeclareRobustCommandas[1]% arrow strike
                              vphantom#1mathpaletteerel@as#1%


                              newcommanderel@as[2]%
                              ooalignhfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr%

                              makeatother

                              begindocument

                              $a+asb+c_asx$

                              enddocument


                              enter image description here






                              share|improve this answer













                              Here's for text in two versions:



                              documentclassarticle

                              DeclareRobustCommandasA[1]% arrow strike
                              leavevmodebegingroup
                              vphantom#1%
                              ooalignhidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr%
                              endgroup

                              DeclareRobustCommandasB[1]% arrow strike
                              leavevmodebegingroup
                              vphantom#1%
                              ooalign$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr%
                              endgroup


                              begindocument

                              stasAruck

                              stasBruck

                              enddocument


                              enter image description here



                              For math:



                              documentclassarticle

                              makeatletter
                              DeclareRobustCommandas[1]% arrow strike
                              vphantom#1mathpaletteerel@as#1%


                              newcommanderel@as[2]%
                              ooalignhfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr%

                              makeatother

                              begindocument

                              $a+asb+c_asx$

                              enddocument


                              enter image description here







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Feb 19 at 14:00









                              egregegreg

                              726k8819223230




                              726k8819223230





















                                  4














                                  In case you want a bit of flexibility and the arrow to adjust to the width of the stuff it is running through, you may want to use tikzmark.



                                  documentclassarticle
                                  usepackagetikz
                                  usetikzlibrarytikzmark
                                  newcounteratm
                                  newcommandarrowthrough[2]stepcounteratmtikzmarknode[path picture=
                                  draw[->,#1] (path picture bounding box.west) --
                                  (path picture bounding box.east);]atm-theatm#2
                                  begindocument
                                  arrowthroughx
                                  [ E=arrowthroughmc^2]
                                  arrowthrough[red,-latex]Hello arrowthrough[latex-,thick,blue]World!
                                  enddocument


                                  enter image description here






                                  share|improve this answer



























                                    4














                                    In case you want a bit of flexibility and the arrow to adjust to the width of the stuff it is running through, you may want to use tikzmark.



                                    documentclassarticle
                                    usepackagetikz
                                    usetikzlibrarytikzmark
                                    newcounteratm
                                    newcommandarrowthrough[2]stepcounteratmtikzmarknode[path picture=
                                    draw[->,#1] (path picture bounding box.west) --
                                    (path picture bounding box.east);]atm-theatm#2
                                    begindocument
                                    arrowthroughx
                                    [ E=arrowthroughmc^2]
                                    arrowthrough[red,-latex]Hello arrowthrough[latex-,thick,blue]World!
                                    enddocument


                                    enter image description here






                                    share|improve this answer

























                                      4












                                      4








                                      4







                                      In case you want a bit of flexibility and the arrow to adjust to the width of the stuff it is running through, you may want to use tikzmark.



                                      documentclassarticle
                                      usepackagetikz
                                      usetikzlibrarytikzmark
                                      newcounteratm
                                      newcommandarrowthrough[2]stepcounteratmtikzmarknode[path picture=
                                      draw[->,#1] (path picture bounding box.west) --
                                      (path picture bounding box.east);]atm-theatm#2
                                      begindocument
                                      arrowthroughx
                                      [ E=arrowthroughmc^2]
                                      arrowthrough[red,-latex]Hello arrowthrough[latex-,thick,blue]World!
                                      enddocument


                                      enter image description here






                                      share|improve this answer













                                      In case you want a bit of flexibility and the arrow to adjust to the width of the stuff it is running through, you may want to use tikzmark.



                                      documentclassarticle
                                      usepackagetikz
                                      usetikzlibrarytikzmark
                                      newcounteratm
                                      newcommandarrowthrough[2]stepcounteratmtikzmarknode[path picture=
                                      draw[->,#1] (path picture bounding box.west) --
                                      (path picture bounding box.east);]atm-theatm#2
                                      begindocument
                                      arrowthroughx
                                      [ E=arrowthroughmc^2]
                                      arrowthrough[red,-latex]Hello arrowthrough[latex-,thick,blue]World!
                                      enddocument


                                      enter image description here







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Feb 19 at 15:57









                                      marmotmarmot

                                      108k5133251




                                      108k5133251



























                                          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%2f475653%2fhow-to-write-a-character-overlapping-another-character%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?

                                          Bahrain

                                          Postfix configuration issue with fips on centos 7; mailgun relay