Environment with comma separated optional argumentsxparse DeclareDocumentEnvironment does not print arguments...

Do authors have to be politically correct in article-writing?

What is better: yes / no radio, or simple checkbox?

Compress command output by piping to bzip2

Would a National Army of mercenaries be a feasible idea?

Pre-1980's science fiction short story: alien disguised as a woman shot by a gangster, has tentacles coming out of her breasts when remaking her body

Contest math problem about crossing out numbers in the table

Strange Sign on Lab Door

Enable Advanced Currency Management using CLI

Is a debit card dangerous for an account with low balance and no overdraft protection?

How would one buy a used TIE Fighter or X-Wing?

Showing size of pie chart in legend of QGIS?

Why does String.replaceAll() work differently in Java 8 from Java 9?

Typing Amharic inside a math equation?

Why doesn't "auto ch = unsigned char{'p'}" compile under C++ 17?

Difference between thick vs thin front suspension?

Are there neural networks with very few nodes that decently solve non-trivial problems?

How to pivot a dataframe with two columns with no index

Checking for the existence of multiple directories

How to deal with an incendiary email that was recalled

The effects of magnetism in radio transmissions

Parsing a string of key-value pairs as a dictionary

Citing paywalled articles accessed via illegal web sharing

Can a dragon be stuck looking like a human?

Why zero tolerance on nudity in space?



Environment with comma separated optional arguments


xparse DeclareDocumentEnvironment does not print arguments in the end code sectionHow can I pass optional arguments as optional arguments?Collecting environment content with support for xparse argumentsPassing * arguments using xparseHow define LaTeX command with 2 or 3 arguments in comma-separated listOptional Parameters in xparse: IfBooleanTF vs IfNoValueTFNot ignoring spaces before optional argument with xparseHow do I add arguments in xparse?Prevent xparse from stripping braces?How to create a string comparison with xparse's NewDocumentCommand?













0















Using xparse, how does one get something like this to work?



documentclass{article}
usepackage{xparse}
ExplSyntaxOn

NewDocumentEnvironment{ anenvironment }{ >{SplitArgument{2}{,}}o }{
begin{ auxanenvironment }[#1]
}{
end{ auxanenvironment }
}

NewDocumentEnvironment{ auxanenvironment }{ O{}o }{
Do~something~with~#1IfValueTF{ #2 }{ ,~and~something~else~with~#2. }{ . }
}{}

ExplSyntaxOff
begin{document}
begin{anenvironment}[this argument, this other argument]
end{anenvironment}

begin{anenvironment}[this argument]
end{anenvironment}
end{document}








share



























    0















    Using xparse, how does one get something like this to work?



    documentclass{article}
    usepackage{xparse}
    ExplSyntaxOn

    NewDocumentEnvironment{ anenvironment }{ >{SplitArgument{2}{,}}o }{
    begin{ auxanenvironment }[#1]
    }{
    end{ auxanenvironment }
    }

    NewDocumentEnvironment{ auxanenvironment }{ O{}o }{
    Do~something~with~#1IfValueTF{ #2 }{ ,~and~something~else~with~#2. }{ . }
    }{}

    ExplSyntaxOff
    begin{document}
    begin{anenvironment}[this argument, this other argument]
    end{anenvironment}

    begin{anenvironment}[this argument]
    end{anenvironment}
    end{document}








    share

























      0












      0








      0








      Using xparse, how does one get something like this to work?



      documentclass{article}
      usepackage{xparse}
      ExplSyntaxOn

      NewDocumentEnvironment{ anenvironment }{ >{SplitArgument{2}{,}}o }{
      begin{ auxanenvironment }[#1]
      }{
      end{ auxanenvironment }
      }

      NewDocumentEnvironment{ auxanenvironment }{ O{}o }{
      Do~something~with~#1IfValueTF{ #2 }{ ,~and~something~else~with~#2. }{ . }
      }{}

      ExplSyntaxOff
      begin{document}
      begin{anenvironment}[this argument, this other argument]
      end{anenvironment}

      begin{anenvironment}[this argument]
      end{anenvironment}
      end{document}








      share














      Using xparse, how does one get something like this to work?



      documentclass{article}
      usepackage{xparse}
      ExplSyntaxOn

      NewDocumentEnvironment{ anenvironment }{ >{SplitArgument{2}{,}}o }{
      begin{ auxanenvironment }[#1]
      }{
      end{ auxanenvironment }
      }

      NewDocumentEnvironment{ auxanenvironment }{ O{}o }{
      Do~something~with~#1IfValueTF{ #2 }{ ,~and~something~else~with~#2. }{ . }
      }{}

      ExplSyntaxOff
      begin{document}
      begin{anenvironment}[this argument, this other argument]
      end{anenvironment}

      begin{anenvironment}[this argument]
      end{anenvironment}
      end{document}






      expl3 latex3 xparse





      share












      share










      share



      share










      asked 5 mins ago









      noibenoibe

      418113




      418113






















          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%2f477377%2fenvironment-with-comma-separated-optional-arguments%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%2f477377%2fenvironment-with-comma-separated-optional-arguments%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

          Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

          Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

          How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...