How to write a character over another characterRange symbol over characterSubstitute a character by another...

Does a star need to be inside a galaxy?

Sing Baby Shark

Why do climate experts from the UN/IPCC never mention Grand Solar Minimum?

Why does RAM (any type) access time decrease so slowly?

Manager has noticed coworker's excessive breaks. Should I warn him?

Contribution form

Ethernet cable only works in certain positions

Why are energy weapons seen as more acceptable in children's shows than guns that fire bullets?

Why does Python copy numpy arrays where the length of the dimensions are the same?

Workplace intimidation due to child's chronic health condition

Negotiating 1-year delay to my Assistant Professor Offer

Python 3.7 UltimateBruteforcer

Is it appropriate to give a culturally-traditional gift to a female coworker?

How should I ship cards?

Sci fi book, man buys a beat up spaceship and intervenes in a civil war on a planet and eventually becomes a space cop

Unable to login to ec2 instance after running “sudo chmod 2770 /”

Badly designed reimbursement form. What does that say about the company?

Taking an academic pseudonym?

How to create a cover page like this?

How can a kingdom keep the secret of a missing monarchy from the public?

Are there any rules or guidelines about the order of saving throws?

I hate taking lectures, can I still survive in academia?

Why is Shelob considered evil?

Someone wants me to use my credit card at a card-only gas/petrol pump in return for cash



How to write a character over another character


Range symbol over characterSubstitute a character by another one (Lualatex)In LyX, is it possible to customize the special characters (specifically symbols)?Using imported font with XeLaTeX - several latin letters for one font symbolCreate a font table for all available characters for a particular fontCreating a custom character that automatically adjusts size in math mode?How/Where to find such special symbol/character?Use specific non-unicode character in lualatexHow to insert a dashed line over a bigwedge symbol so that the dashed line behaves like overline would?Modify characters of mt2pro[lite] using TimesUniform convergence symbol (arrow on top of arrow, same size)Range symbol over character













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
    5 hours ago











  • 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
    4 hours ago
















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
    5 hours ago











  • 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
    4 hours ago














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 1 hour ago









JouleV

3,7771936




3,7771936










asked 5 hours ago









Erel Segal-HaleviErel Segal-Halevi

2,42762242




2,42762242








  • 5





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

    – egreg
    5 hours ago











  • 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
    4 hours ago














  • 5





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

    – egreg
    5 hours ago











  • 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
    4 hours ago








5




5





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

– egreg
5 hours ago





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

– egreg
5 hours ago













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
4 hours ago





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
4 hours ago










4 Answers
4






active

oldest

votes


















10














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



documentclass{article}
usepackage{stackengine}
begin{document}
In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{T}{L}t...

$ensurestackMath{stackengine{0pt}{y}{rightarrow}{O}{c}{F}{T}{L}} = mx + b$
end{document}


enter image description here



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



documentclass{article}
usepackage{stackengine}
begin{document}
In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{F}{L}t...

$ensurestackMath{stackengine{0pt}{y}{rightarrow!}{O}{c}{F}{F}{L}} = mx + b$
end{document}


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:



documentclass{article}
usepackage{stackengine,scalerel}
newcommandoverarrow[1]{ThisStyle{ensurestackMath{%
stackengine{0pt}{SavedStyle#1}{SavedStylerightarrow!}{O}{c}{F}{F}{L}}}}
begin{document}
$overarrow{y} = mx_{overarrow{z}} + b$
end{document}


enter image description here






share|improve this answer

































    8














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



    documentclass[12pt,a4paper]{article}    
    begin{document}

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

    end{document}


    enter image description here






    share|improve this answer































      5














      Here's for text in two versions:



      documentclass{article}

      DeclareRobustCommand{asA}[1]{% arrow strike
      leavevmodebegingroup
      vphantom{#1}%
      ooalign{hidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr}%
      endgroup
      }
      DeclareRobustCommand{asB}[1]{% arrow strike
      leavevmodebegingroup
      vphantom{#1}%
      ooalign{$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr}%
      endgroup
      }

      begin{document}

      stasA{r}uck

      stasB{r}uck

      end{document}


      enter image description here



      For math:



      documentclass{article}

      makeatletter
      DeclareRobustCommand{as}[1]{% arrow strike
      {vphantom{#1}mathpaletteerel@as{#1}}%
      }

      newcommand{erel@as}[2]{%
      ooalign{hfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr}%
      }
      makeatother

      begin{document}

      $a+as{b}+c_{as{x}}$

      end{document}


      enter image description here






      share|improve this answer































        3














        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.



        documentclass{article}
        usepackage{tikz}
        usetikzlibrary{tikzmark}
        newcounter{atm}
        newcommand{arrowthrough}[2][]{stepcounter{atm}tikzmarknode[path picture={
        draw[->,#1] (path picture bounding box.west) --
        (path picture bounding box.east);}]{atm-theatm}{#2}}
        begin{document}
        arrowthrough{x}
        [ E=arrowthrough{m}c^2]
        arrowthrough[red,-latex]{Hello} arrowthrough[latex-,thick,blue]{World!}
        end{document}


        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-over-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









          10














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



          documentclass{article}
          usepackage{stackengine}
          begin{document}
          In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{T}{L}t...

          $ensurestackMath{stackengine{0pt}{y}{rightarrow}{O}{c}{F}{T}{L}} = mx + b$
          end{document}


          enter image description here



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



          documentclass{article}
          usepackage{stackengine}
          begin{document}
          In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{F}{L}t...

          $ensurestackMath{stackengine{0pt}{y}{rightarrow!}{O}{c}{F}{F}{L}} = mx + b$
          end{document}


          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:



          documentclass{article}
          usepackage{stackengine,scalerel}
          newcommandoverarrow[1]{ThisStyle{ensurestackMath{%
          stackengine{0pt}{SavedStyle#1}{SavedStylerightarrow!}{O}{c}{F}{F}{L}}}}
          begin{document}
          $overarrow{y} = mx_{overarrow{z}} + b$
          end{document}


          enter image description here






          share|improve this answer






























            10














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



            documentclass{article}
            usepackage{stackengine}
            begin{document}
            In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{T}{L}t...

            $ensurestackMath{stackengine{0pt}{y}{rightarrow}{O}{c}{F}{T}{L}} = mx + b$
            end{document}


            enter image description here



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



            documentclass{article}
            usepackage{stackengine}
            begin{document}
            In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{F}{L}t...

            $ensurestackMath{stackengine{0pt}{y}{rightarrow!}{O}{c}{F}{F}{L}} = mx + b$
            end{document}


            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:



            documentclass{article}
            usepackage{stackengine,scalerel}
            newcommandoverarrow[1]{ThisStyle{ensurestackMath{%
            stackengine{0pt}{SavedStyle#1}{SavedStylerightarrow!}{O}{c}{F}{F}{L}}}}
            begin{document}
            $overarrow{y} = mx_{overarrow{z}} + b$
            end{document}


            enter image description here






            share|improve this answer




























              10












              10








              10







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



              documentclass{article}
              usepackage{stackengine}
              begin{document}
              In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{T}{L}t...

              $ensurestackMath{stackengine{0pt}{y}{rightarrow}{O}{c}{F}{T}{L}} = mx + b$
              end{document}


              enter image description here



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



              documentclass{article}
              usepackage{stackengine}
              begin{document}
              In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{F}{L}t...

              $ensurestackMath{stackengine{0pt}{y}{rightarrow!}{O}{c}{F}{F}{L}} = mx + b$
              end{document}


              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:



              documentclass{article}
              usepackage{stackengine,scalerel}
              newcommandoverarrow[1]{ThisStyle{ensurestackMath{%
              stackengine{0pt}{SavedStyle#1}{SavedStylerightarrow!}{O}{c}{F}{F}{L}}}}
              begin{document}
              $overarrow{y} = mx_{overarrow{z}} + b$
              end{document}


              enter image description here






              share|improve this answer















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



              documentclass{article}
              usepackage{stackengine}
              begin{document}
              In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{T}{L}t...

              $ensurestackMath{stackengine{0pt}{y}{rightarrow}{O}{c}{F}{T}{L}} = mx + b$
              end{document}


              enter image description here



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



              documentclass{article}
              usepackage{stackengine}
              begin{document}
              In testackengine{0pt}{x}{$rightarrow$}{O}{c}{F}{F}{L}t...

              $ensurestackMath{stackengine{0pt}{y}{rightarrow!}{O}{c}{F}{F}{L}} = mx + b$
              end{document}


              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:



              documentclass{article}
              usepackage{stackengine,scalerel}
              newcommandoverarrow[1]{ThisStyle{ensurestackMath{%
              stackengine{0pt}{SavedStyle#1}{SavedStylerightarrow!}{O}{c}{F}{F}{L}}}}
              begin{document}
              $overarrow{y} = mx_{overarrow{z}} + b$
              end{document}


              enter image description here







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 5 hours ago

























              answered 5 hours ago









              Steven B. SegletesSteven B. Segletes

              156k9200410




              156k9200410























                  8














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



                  documentclass[12pt,a4paper]{article}    
                  begin{document}

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

                  end{document}


                  enter image description here






                  share|improve this answer




























                    8














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



                    documentclass[12pt,a4paper]{article}    
                    begin{document}

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

                    end{document}


                    enter image description here






                    share|improve this answer


























                      8












                      8








                      8







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



                      documentclass[12pt,a4paper]{article}    
                      begin{document}

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

                      end{document}


                      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}    
                      begin{document}

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

                      end{document}


                      enter image description here







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered 5 hours ago









                      AboAmmarAboAmmar

                      34k32883




                      34k32883























                          5














                          Here's for text in two versions:



                          documentclass{article}

                          DeclareRobustCommand{asA}[1]{% arrow strike
                          leavevmodebegingroup
                          vphantom{#1}%
                          ooalign{hidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr}%
                          endgroup
                          }
                          DeclareRobustCommand{asB}[1]{% arrow strike
                          leavevmodebegingroup
                          vphantom{#1}%
                          ooalign{$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr}%
                          endgroup
                          }

                          begin{document}

                          stasA{r}uck

                          stasB{r}uck

                          end{document}


                          enter image description here



                          For math:



                          documentclass{article}

                          makeatletter
                          DeclareRobustCommand{as}[1]{% arrow strike
                          {vphantom{#1}mathpaletteerel@as{#1}}%
                          }

                          newcommand{erel@as}[2]{%
                          ooalign{hfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr}%
                          }
                          makeatother

                          begin{document}

                          $a+as{b}+c_{as{x}}$

                          end{document}


                          enter image description here






                          share|improve this answer




























                            5














                            Here's for text in two versions:



                            documentclass{article}

                            DeclareRobustCommand{asA}[1]{% arrow strike
                            leavevmodebegingroup
                            vphantom{#1}%
                            ooalign{hidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr}%
                            endgroup
                            }
                            DeclareRobustCommand{asB}[1]{% arrow strike
                            leavevmodebegingroup
                            vphantom{#1}%
                            ooalign{$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr}%
                            endgroup
                            }

                            begin{document}

                            stasA{r}uck

                            stasB{r}uck

                            end{document}


                            enter image description here



                            For math:



                            documentclass{article}

                            makeatletter
                            DeclareRobustCommand{as}[1]{% arrow strike
                            {vphantom{#1}mathpaletteerel@as{#1}}%
                            }

                            newcommand{erel@as}[2]{%
                            ooalign{hfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr}%
                            }
                            makeatother

                            begin{document}

                            $a+as{b}+c_{as{x}}$

                            end{document}


                            enter image description here






                            share|improve this answer


























                              5












                              5








                              5







                              Here's for text in two versions:



                              documentclass{article}

                              DeclareRobustCommand{asA}[1]{% arrow strike
                              leavevmodebegingroup
                              vphantom{#1}%
                              ooalign{hidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr}%
                              endgroup
                              }
                              DeclareRobustCommand{asB}[1]{% arrow strike
                              leavevmodebegingroup
                              vphantom{#1}%
                              ooalign{$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr}%
                              endgroup
                              }

                              begin{document}

                              stasA{r}uck

                              stasB{r}uck

                              end{document}


                              enter image description here



                              For math:



                              documentclass{article}

                              makeatletter
                              DeclareRobustCommand{as}[1]{% arrow strike
                              {vphantom{#1}mathpaletteerel@as{#1}}%
                              }

                              newcommand{erel@as}[2]{%
                              ooalign{hfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr}%
                              }
                              makeatother

                              begin{document}

                              $a+as{b}+c_{as{x}}$

                              end{document}


                              enter image description here






                              share|improve this answer













                              Here's for text in two versions:



                              documentclass{article}

                              DeclareRobustCommand{asA}[1]{% arrow strike
                              leavevmodebegingroup
                              vphantom{#1}%
                              ooalign{hidewidth$mathsurround0ptrightarrow$hidewidthcr#1cr}%
                              endgroup
                              }
                              DeclareRobustCommand{asB}[1]{% arrow strike
                              leavevmodebegingroup
                              vphantom{#1}%
                              ooalign{$mathsurround0ptrightarrow$crhidewidth#1hidewidthcr}%
                              endgroup
                              }

                              begin{document}

                              stasA{r}uck

                              stasB{r}uck

                              end{document}


                              enter image description here



                              For math:



                              documentclass{article}

                              makeatletter
                              DeclareRobustCommand{as}[1]{% arrow strike
                              {vphantom{#1}mathpaletteerel@as{#1}}%
                              }

                              newcommand{erel@as}[2]{%
                              ooalign{hfil$m@th#1rightarrow$hfilcrhfil$m@th#1#2$hfilcr}%
                              }
                              makeatother

                              begin{document}

                              $a+as{b}+c_{as{x}}$

                              end{document}


                              enter image description here







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 5 hours ago









                              egregegreg

                              721k8719093209




                              721k8719093209























                                  3














                                  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.



                                  documentclass{article}
                                  usepackage{tikz}
                                  usetikzlibrary{tikzmark}
                                  newcounter{atm}
                                  newcommand{arrowthrough}[2][]{stepcounter{atm}tikzmarknode[path picture={
                                  draw[->,#1] (path picture bounding box.west) --
                                  (path picture bounding box.east);}]{atm-theatm}{#2}}
                                  begin{document}
                                  arrowthrough{x}
                                  [ E=arrowthrough{m}c^2]
                                  arrowthrough[red,-latex]{Hello} arrowthrough[latex-,thick,blue]{World!}
                                  end{document}


                                  enter image description here






                                  share|improve this answer




























                                    3














                                    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.



                                    documentclass{article}
                                    usepackage{tikz}
                                    usetikzlibrary{tikzmark}
                                    newcounter{atm}
                                    newcommand{arrowthrough}[2][]{stepcounter{atm}tikzmarknode[path picture={
                                    draw[->,#1] (path picture bounding box.west) --
                                    (path picture bounding box.east);}]{atm-theatm}{#2}}
                                    begin{document}
                                    arrowthrough{x}
                                    [ E=arrowthrough{m}c^2]
                                    arrowthrough[red,-latex]{Hello} arrowthrough[latex-,thick,blue]{World!}
                                    end{document}


                                    enter image description here






                                    share|improve this answer


























                                      3












                                      3








                                      3







                                      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.



                                      documentclass{article}
                                      usepackage{tikz}
                                      usetikzlibrary{tikzmark}
                                      newcounter{atm}
                                      newcommand{arrowthrough}[2][]{stepcounter{atm}tikzmarknode[path picture={
                                      draw[->,#1] (path picture bounding box.west) --
                                      (path picture bounding box.east);}]{atm-theatm}{#2}}
                                      begin{document}
                                      arrowthrough{x}
                                      [ E=arrowthrough{m}c^2]
                                      arrowthrough[red,-latex]{Hello} arrowthrough[latex-,thick,blue]{World!}
                                      end{document}


                                      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.



                                      documentclass{article}
                                      usepackage{tikz}
                                      usetikzlibrary{tikzmark}
                                      newcounter{atm}
                                      newcommand{arrowthrough}[2][]{stepcounter{atm}tikzmarknode[path picture={
                                      draw[->,#1] (path picture bounding box.west) --
                                      (path picture bounding box.east);}]{atm-theatm}{#2}}
                                      begin{document}
                                      arrowthrough{x}
                                      [ E=arrowthrough{m}c^2]
                                      arrowthrough[red,-latex]{Hello} arrowthrough[latex-,thick,blue]{World!}
                                      end{document}


                                      enter image description here







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered 3 hours ago









                                      marmotmarmot

                                      101k4119228




                                      101k4119228






























                                          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-over-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

                                          Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

                                          Always On Availability groups resolving state after failover - Remote harden of transaction...

                                          update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...