How to copy minus as hyphen?

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











up vote
2
down vote

favorite
1












There is a question about minuses in listings.



Is it possible to make (document-wide) the minus sign (−) to look like the typographic minus, but be copied from the resulting PDF as the hyphen (-), used in source code?










share|improve this question



























    up vote
    2
    down vote

    favorite
    1












    There is a question about minuses in listings.



    Is it possible to make (document-wide) the minus sign (−) to look like the typographic minus, but be copied from the resulting PDF as the hyphen (-), used in source code?










    share|improve this question

























      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      There is a question about minuses in listings.



      Is it possible to make (document-wide) the minus sign (−) to look like the typographic minus, but be copied from the resulting PDF as the hyphen (-), used in source code?










      share|improve this question















      There is a question about minuses in listings.



      Is it possible to make (document-wide) the minus sign (−) to look like the typographic minus, but be copied from the resulting PDF as the hyphen (-), used in source code?







      math-mode symbols pdf copy-paste






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 mins ago

























      asked 54 mins ago









      homocomputeris

      717




      717




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote













          documentclassarticle
          usepackageaccsupp
          newcommandpdfminusBeginAccSuppmethod=escape,ActualText=--EndAccSupp
          begindocument
          $pdfminus A pdfminus B = C$

          $-A - B = C$
          enddocument


          enter image description here



          Copy/paste yields:



          -A - B = C
          􀀀A 􀀀 B = C





          share|improve this answer






















          • Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
            – homocomputeris
            3 mins ago










          • @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
            – Steven B. Segletes
            32 secs ago










          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: "",
          imageUploader:
          brandingHtml: "",
          contentPolicyHtml: "",
          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%2f457718%2fhow-to-copy-minus-as-hyphen%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote













          documentclassarticle
          usepackageaccsupp
          newcommandpdfminusBeginAccSuppmethod=escape,ActualText=--EndAccSupp
          begindocument
          $pdfminus A pdfminus B = C$

          $-A - B = C$
          enddocument


          enter image description here



          Copy/paste yields:



          -A - B = C
          􀀀A 􀀀 B = C





          share|improve this answer






















          • Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
            – homocomputeris
            3 mins ago










          • @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
            – Steven B. Segletes
            32 secs ago














          up vote
          4
          down vote













          documentclassarticle
          usepackageaccsupp
          newcommandpdfminusBeginAccSuppmethod=escape,ActualText=--EndAccSupp
          begindocument
          $pdfminus A pdfminus B = C$

          $-A - B = C$
          enddocument


          enter image description here



          Copy/paste yields:



          -A - B = C
          􀀀A 􀀀 B = C





          share|improve this answer






















          • Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
            – homocomputeris
            3 mins ago










          • @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
            – Steven B. Segletes
            32 secs ago












          up vote
          4
          down vote










          up vote
          4
          down vote









          documentclassarticle
          usepackageaccsupp
          newcommandpdfminusBeginAccSuppmethod=escape,ActualText=--EndAccSupp
          begindocument
          $pdfminus A pdfminus B = C$

          $-A - B = C$
          enddocument


          enter image description here



          Copy/paste yields:



          -A - B = C
          􀀀A 􀀀 B = C





          share|improve this answer














          documentclassarticle
          usepackageaccsupp
          newcommandpdfminusBeginAccSuppmethod=escape,ActualText=--EndAccSupp
          begindocument
          $pdfminus A pdfminus B = C$

          $-A - B = C$
          enddocument


          enter image description here



          Copy/paste yields:



          -A - B = C
          􀀀A 􀀀 B = C






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 27 mins ago

























          answered 33 mins ago









          Steven B. Segletes

          150k9188395




          150k9188395











          • Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
            – homocomputeris
            3 mins ago










          • @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
            – Steven B. Segletes
            32 secs ago
















          • Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
            – homocomputeris
            3 mins ago










          • @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
            – Steven B. Segletes
            32 secs ago















          Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
          – homocomputeris
          3 mins ago




          Is it possible to seamlessly substitute it, without creating a new command and typing it every time?
          – homocomputeris
          3 mins ago












          @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
          – Steven B. Segletes
          32 secs ago




          @homocomputeris There is no way, in a general sense, to do this in pdflatex (maybe there is in lualatex...I don't know). What can be done is temporarily making - active and redirecting it to pdfminus within the scope of the active minus. However, you can't leave it active all the time, or it screws up any calculation requiring a length or integer subtraction.
          – Steven B. Segletes
          32 secs ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457718%2fhow-to-copy-minus-as-hyphen%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery