Using command/macro as an optional argument The Next CEO of Stack OverflowVariable-name...

Would a galaxy be visible from outside, but nearby?

Unreliable Magic - Is it worth it?

Between two walls

How do I go from 300 unfinished/half written blog posts, to published posts?

Workaholic Formal/Informal

How to subset dataframe based on a "not equal to" criteria applied to a large number of columns?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Is it ever safe to open a suspicious html file (e.g. email attachment)?

What is the result of assigning to std::vector<T>::begin()?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Bold, vivid family

Are there any limitations on attacking while grappling?

Non-deterministic sum of floats

Can I equip Skullclamp on a creature I am sacrificing?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Inappropriate reference requests from Journal reviewers

Should I tutor a student who I know has cheated on their homework?

How should I support this large drywall patch?

How fast would a person need to move to trick the eye?

Is there a way to save my career from absolute disaster?

At which OSI layer a user-generated data resides?

Can we say or write : "No, it'sn't"?

How to count occurrences of text in a file?

How do scammers retract money, while you can’t?



Using command/macro as an optional argument



The Next CEO of Stack OverflowVariable-name newcommand with parameters within another newcommandnewcommand to make a plot command using gnuplottexUsing notblank in etoolbox's ifboolexpr statmentCan new command end with a number?Bold or arrow vectors with new commandHow to use variables in calculations when defining a new TikZ commandUsing macro with optional argument inside macro with optional argumentNewcommand with macros as inputUnable to pass result of one command as argument to anotherMacro based flags for forest tree












0















I have a bunch of images to include and want to use the same clip parameters on them. The approach I'm taking doesn't seem to work though:



This works:



includegraphics[clip,trim=0 0 80px 80px, width=xtextwidth]{image}   


This doesn't:



newcommandx{.22}
newcommandmytrim{0 0 80px 80px}
includegraphics[clip,trim=mytrim, width=xtextwidth]{image}
^ ^- Does work
^- Doesn't work


What am I doing wrong?









share



























    0















    I have a bunch of images to include and want to use the same clip parameters on them. The approach I'm taking doesn't seem to work though:



    This works:



    includegraphics[clip,trim=0 0 80px 80px, width=xtextwidth]{image}   


    This doesn't:



    newcommandx{.22}
    newcommandmytrim{0 0 80px 80px}
    includegraphics[clip,trim=mytrim, width=xtextwidth]{image}
    ^ ^- Does work
    ^- Doesn't work


    What am I doing wrong?









    share

























      0












      0








      0








      I have a bunch of images to include and want to use the same clip parameters on them. The approach I'm taking doesn't seem to work though:



      This works:



      includegraphics[clip,trim=0 0 80px 80px, width=xtextwidth]{image}   


      This doesn't:



      newcommandx{.22}
      newcommandmytrim{0 0 80px 80px}
      includegraphics[clip,trim=mytrim, width=xtextwidth]{image}
      ^ ^- Does work
      ^- Doesn't work


      What am I doing wrong?









      share














      I have a bunch of images to include and want to use the same clip parameters on them. The approach I'm taking doesn't seem to work though:



      This works:



      includegraphics[clip,trim=0 0 80px 80px, width=xtextwidth]{image}   


      This doesn't:



      newcommandx{.22}
      newcommandmytrim{0 0 80px 80px}
      includegraphics[clip,trim=mytrim, width=xtextwidth]{image}
      ^ ^- Does work
      ^- Doesn't work


      What am I doing wrong?







      macros





      share












      share










      share



      share










      asked 3 mins ago









      argentum2fargentum2f

      1486




      1486






















          0






          active

          oldest

          votes












          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%2f482179%2fusing-command-macro-as-an-optional-argument%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f482179%2fusing-command-macro-as-an-optional-argument%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

          IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

          Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

          Glossaries-extra: Adding glossaries package to “Clas­sicTh­e­sis” template by Dr. André Miede v. 4.6 ...