What does nop mean and how to use itComment out `lstinputlisting` without actually removing themWhat does marks do?What does @let@token do?What does ifx\#1\ stand for?What do newcommand, renewcommand, and providecommand do, and how do they differ?What does p@ mean in some code?What's the difference between format and macro language?What does the command ifCLASSINFOpdf mean?What does csappto does and where does it come from?How does delimiter work? How does it convert its argument into character(s?) and why?What does bbbn mean?

How to explain what's wrong with this application of the chain rule?

How does electrical safety system work on ISS?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

Microchip documentation does not label CAN buss pins on micro controller pinout diagram

What is Cash Advance APR?

awk assign to multiple variables at once

Has any country ever had 2 former presidents in jail simultaneously?

What fields between the rationals and the reals allow a good notion of 2D distance?

Is this toilet slogan correct usage of the English language?

How to convince somebody that he is fit for something else, but not this job?

Is it allowed to activate the ability of multiple planeswalkers in a single turn?

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

The IT department bottlenecks progress, how should I handle this?

Why is it that I can sometimes guess the next note?

What kind of floor tile is this?

Which Article Helped Get Rid of Technobabble in RPGs?

Review your own paper in Mathematics

Is there a RAID 0 Equivalent for RAM?

Biological Blimps: Propulsion

A Trivial Diagnosis

Non-trope happy ending?

Is it ethical to recieve stipend after publishing enough papers?

How could a planet have erratic days?



What does nop mean and how to use it


Comment out `lstinputlisting` without actually removing themWhat does marks do?What does @let@token do?What does ifx\#1\ stand for?What do newcommand, renewcommand, and providecommand do, and how do they differ?What does p@ mean in some code?What's the difference between format and macro language?What does the command ifCLASSINFOpdf mean?What does csappto does and where does it come from?How does delimiter work? How does it convert its argument into character(s?) and why?What does bbbn mean?













4















I wonder what does the nop mean, and how does it work? I Googled it but couldn't find a good answer, for example, I found something like:



newcommandnop[1]


in my .tex file, so what does it mean?










share|improve this question




























    4















    I wonder what does the nop mean, and how does it work? I Googled it but couldn't find a good answer, for example, I found something like:



    newcommandnop[1]


    in my .tex file, so what does it mean?










    share|improve this question


























      4












      4








      4








      I wonder what does the nop mean, and how does it work? I Googled it but couldn't find a good answer, for example, I found something like:



      newcommandnop[1]


      in my .tex file, so what does it mean?










      share|improve this question
















      I wonder what does the nop mean, and how does it work? I Googled it but couldn't find a good answer, for example, I found something like:



      newcommandnop[1]


      in my .tex file, so what does it mean?







      macros






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 16 '13 at 14:34









      Werner

      448k709921697




      448k709921697










      asked Apr 16 '13 at 14:32









      daiyuedaiyue

      2672512




      2672512




















          1 Answer
          1






          active

          oldest

          votes


















          6














          In your example, nop is defined to take a single argument and do nothing with it. As such, nop literally translates to "perform no operation", or "gobble your argument". In fact, there exists a similar core macro @gobble (and friends) which does exactly the same (from latex.ltx:



          longdef @gobble #1
          longdef @gobbletwo #1#2
          longdef @gobblefour #1#2#3#4


          The first gobbles a single argument, making @gobble<anything> expand to nothing. The second gobbles two arguments, making @gobbletwo<anything><anything> expand to nothing, and so on.



          What's the use case here? Well, perhaps you define a macro that writes something in the margin, like a "to do" note:



          newcommandmymacro[1]marginparDo #1


          Now, later in your production, you decide that this operation is no longer valid/useful. So, you can make mymacro act like nop and do nothing, which allows you to leave your code as-is:



          letmymacronop


          or, at definition in your preamble, change it to a no-op:



          newcommandmymacro[1]





          share|improve this answer























          • another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

            – daiyue
            Apr 16 '13 at 14:46







          • 1





            @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

            – barbara beeton
            Apr 16 '13 at 14:52











          • Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

            – mafp
            Apr 16 '13 at 15:49











          • The nop definition in the question, produces an extra space.

            – ctrl-alt-delor
            Jul 8 '18 at 17:35











          • @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

            – Werner
            Jul 8 '18 at 18:41










          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%2f109039%2fwhat-does-nop-mean-and-how-to-use-it%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          6














          In your example, nop is defined to take a single argument and do nothing with it. As such, nop literally translates to "perform no operation", or "gobble your argument". In fact, there exists a similar core macro @gobble (and friends) which does exactly the same (from latex.ltx:



          longdef @gobble #1
          longdef @gobbletwo #1#2
          longdef @gobblefour #1#2#3#4


          The first gobbles a single argument, making @gobble<anything> expand to nothing. The second gobbles two arguments, making @gobbletwo<anything><anything> expand to nothing, and so on.



          What's the use case here? Well, perhaps you define a macro that writes something in the margin, like a "to do" note:



          newcommandmymacro[1]marginparDo #1


          Now, later in your production, you decide that this operation is no longer valid/useful. So, you can make mymacro act like nop and do nothing, which allows you to leave your code as-is:



          letmymacronop


          or, at definition in your preamble, change it to a no-op:



          newcommandmymacro[1]





          share|improve this answer























          • another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

            – daiyue
            Apr 16 '13 at 14:46







          • 1





            @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

            – barbara beeton
            Apr 16 '13 at 14:52











          • Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

            – mafp
            Apr 16 '13 at 15:49











          • The nop definition in the question, produces an extra space.

            – ctrl-alt-delor
            Jul 8 '18 at 17:35











          • @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

            – Werner
            Jul 8 '18 at 18:41















          6














          In your example, nop is defined to take a single argument and do nothing with it. As such, nop literally translates to "perform no operation", or "gobble your argument". In fact, there exists a similar core macro @gobble (and friends) which does exactly the same (from latex.ltx:



          longdef @gobble #1
          longdef @gobbletwo #1#2
          longdef @gobblefour #1#2#3#4


          The first gobbles a single argument, making @gobble<anything> expand to nothing. The second gobbles two arguments, making @gobbletwo<anything><anything> expand to nothing, and so on.



          What's the use case here? Well, perhaps you define a macro that writes something in the margin, like a "to do" note:



          newcommandmymacro[1]marginparDo #1


          Now, later in your production, you decide that this operation is no longer valid/useful. So, you can make mymacro act like nop and do nothing, which allows you to leave your code as-is:



          letmymacronop


          or, at definition in your preamble, change it to a no-op:



          newcommandmymacro[1]





          share|improve this answer























          • another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

            – daiyue
            Apr 16 '13 at 14:46







          • 1





            @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

            – barbara beeton
            Apr 16 '13 at 14:52











          • Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

            – mafp
            Apr 16 '13 at 15:49











          • The nop definition in the question, produces an extra space.

            – ctrl-alt-delor
            Jul 8 '18 at 17:35











          • @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

            – Werner
            Jul 8 '18 at 18:41













          6












          6








          6







          In your example, nop is defined to take a single argument and do nothing with it. As such, nop literally translates to "perform no operation", or "gobble your argument". In fact, there exists a similar core macro @gobble (and friends) which does exactly the same (from latex.ltx:



          longdef @gobble #1
          longdef @gobbletwo #1#2
          longdef @gobblefour #1#2#3#4


          The first gobbles a single argument, making @gobble<anything> expand to nothing. The second gobbles two arguments, making @gobbletwo<anything><anything> expand to nothing, and so on.



          What's the use case here? Well, perhaps you define a macro that writes something in the margin, like a "to do" note:



          newcommandmymacro[1]marginparDo #1


          Now, later in your production, you decide that this operation is no longer valid/useful. So, you can make mymacro act like nop and do nothing, which allows you to leave your code as-is:



          letmymacronop


          or, at definition in your preamble, change it to a no-op:



          newcommandmymacro[1]





          share|improve this answer













          In your example, nop is defined to take a single argument and do nothing with it. As such, nop literally translates to "perform no operation", or "gobble your argument". In fact, there exists a similar core macro @gobble (and friends) which does exactly the same (from latex.ltx:



          longdef @gobble #1
          longdef @gobbletwo #1#2
          longdef @gobblefour #1#2#3#4


          The first gobbles a single argument, making @gobble<anything> expand to nothing. The second gobbles two arguments, making @gobbletwo<anything><anything> expand to nothing, and so on.



          What's the use case here? Well, perhaps you define a macro that writes something in the margin, like a "to do" note:



          newcommandmymacro[1]marginparDo #1


          Now, later in your production, you decide that this operation is no longer valid/useful. So, you can make mymacro act like nop and do nothing, which allows you to leave your code as-is:



          letmymacronop


          or, at definition in your preamble, change it to a no-op:



          newcommandmymacro[1]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 16 '13 at 14:37









          WernerWerner

          448k709921697




          448k709921697












          • another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

            – daiyue
            Apr 16 '13 at 14:46







          • 1





            @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

            – barbara beeton
            Apr 16 '13 at 14:52











          • Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

            – mafp
            Apr 16 '13 at 15:49











          • The nop definition in the question, produces an extra space.

            – ctrl-alt-delor
            Jul 8 '18 at 17:35











          • @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

            – Werner
            Jul 8 '18 at 18:41

















          • another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

            – daiyue
            Apr 16 '13 at 14:46







          • 1





            @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

            – barbara beeton
            Apr 16 '13 at 14:52











          • Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

            – mafp
            Apr 16 '13 at 15:49











          • The nop definition in the question, produces an extra space.

            – ctrl-alt-delor
            Jul 8 '18 at 17:35











          • @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

            – Werner
            Jul 8 '18 at 18:41
















          another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

          – daiyue
          Apr 16 '13 at 14:46






          another thing that confused me is that any paragraph that is enclosed in this nop command using the macro in the example, is disappeared, so i wonder why.

          – daiyue
          Apr 16 '13 at 14:46





          1




          1





          @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

          – barbara beeton
          Apr 16 '13 at 14:52





          @daiyue -- making anything presented as an argument to nop disappear is exactly its purpose.

          – barbara beeton
          Apr 16 '13 at 14:52













          Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

          – mafp
          Apr 16 '13 at 15:49





          Something like nop is also frequently used in conjunction with BibTeX to fix the sorting order.

          – mafp
          Apr 16 '13 at 15:49













          The nop definition in the question, produces an extra space.

          – ctrl-alt-delor
          Jul 8 '18 at 17:35





          The nop definition in the question, produces an extra space.

          – ctrl-alt-delor
          Jul 8 '18 at 17:35













          @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

          – Werner
          Jul 8 '18 at 18:41





          @ctrl-alt-delor: you can add ignorespaces or unskip or use a trailing %.

          – Werner
          Jul 8 '18 at 18:41

















          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%2f109039%2fwhat-does-nop-mean-and-how-to-use-it%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

          Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

          Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

          Are small insurances worth itIs insurance worth it if you can afford to replace the item? If not, when is it?Is accident insurance worth it for my kids who play sportsIs insuring property for more than it is worth allowed?At what point does it become worth it to file an insurance claim?Are wage loss insurance programs worth the cost compared to having an emergency fund?When is an event worth insuring against?Is insurance worth it if you can afford to replace the item? If not, when is it?FHA loan just commenced : Any way to get any of the up-front mortgage insurance back?Which types of insurances do I need to buy?Should I carry less renter's insurance if I can self-insure?Mortgage Adviser Signed Me Up For Multiple Home and Life Insurances (UK)Why many travel insurances don't cover country of nationality?