A command with a variable number of arguments: comma versus and [duplicate]Commands that may take a variable number of argumentsrelative hspace in newcommandIterating through comma-separated argumentsCommand with variable number of arguments to format menu sequencesProcessing “List” of “List”Aliasing a variable argument command into tabular environmentDynamic length variable with argument? (like “setlengthfoo[1]0.5+#1*0.5”)Variable number of arguments in a commandOptional arguments in “families”… When and how?Command to format any number of equationsAn ellipsis with N dots

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

Closest Prime Number

Avoiding estate tax by giving multiple gifts

Term for the "extreme-extension" version of a straw man fallacy?

Is the destination of a commercial flight important for the pilot?

How to be diplomatic in refusing to write code that breaches the privacy of our users

Why Were Madagascar and New Zealand Discovered So Late?

Do all network devices need to make routing decisions, regardless of communication across networks or within a network?

Detecting if an element is found inside a container

Is `x >> pure y` equivalent to `liftM (const y) x`

What does the word "Atten" mean?

How does it work when somebody invests in my business?

Class Action - which options I have?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

Implement the Thanos sorting algorithm

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Purchasing a ticket for someone else in another country?

Is a stroke of luck acceptable after a series of unfavorable events?

What can we do to stop prior company from asking us questions?

Is there a problem with hiding "forgot password" until it's needed?

Gears on left are inverse to gears on right?

Proof of work - lottery approach

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

Lay out the Carpet



A command with a variable number of arguments: comma versus and [duplicate]


Commands that may take a variable number of argumentsrelative hspace in newcommandIterating through comma-separated argumentsCommand with variable number of arguments to format menu sequencesProcessing “List” of “List”Aliasing a variable argument command into tabular environmentDynamic length variable with argument? (like “setlengthfoo[1]0.5+#1*0.5”)Variable number of arguments in a commandOptional arguments in “families”… When and how?Command to format any number of equationsAn ellipsis with N dots













1
















This question already has an answer here:



  • Commands that may take a variable number of arguments

    3 answers



I have the following command: newcommandtriangles[2]triangles $triangle #1$ and $triangle #2, such that trianglesABCDEF produces triangles $triangle ABC$ and $triangle DEF$. I would like to expand that command such that it can take any number of arguments and such that trianglesABCDEFGHIJKL produces triangles $triangle ABC$, $triangle DEF$, $triangle GHI$ and $triangle DEF$. I have seen a solution somewhere for a shoppinglist that makes use of makeatletter and some TeX command, but this is more difficult, I think, because before you add the current argument, you need to know whether it is the last argument (if not: put a comma, if yes: put "and").










share|improve this question









New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by KJO, JouleV, Dox, flav, Stefan Pinnow 6 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

    – Ulrich Diez
    3 hours ago















1
















This question already has an answer here:



  • Commands that may take a variable number of arguments

    3 answers



I have the following command: newcommandtriangles[2]triangles $triangle #1$ and $triangle #2, such that trianglesABCDEF produces triangles $triangle ABC$ and $triangle DEF$. I would like to expand that command such that it can take any number of arguments and such that trianglesABCDEFGHIJKL produces triangles $triangle ABC$, $triangle DEF$, $triangle GHI$ and $triangle DEF$. I have seen a solution somewhere for a shoppinglist that makes use of makeatletter and some TeX command, but this is more difficult, I think, because before you add the current argument, you need to know whether it is the last argument (if not: put a comma, if yes: put "and").










share|improve this question









New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by KJO, JouleV, Dox, flav, Stefan Pinnow 6 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

    – Ulrich Diez
    3 hours ago













1












1








1









This question already has an answer here:



  • Commands that may take a variable number of arguments

    3 answers



I have the following command: newcommandtriangles[2]triangles $triangle #1$ and $triangle #2, such that trianglesABCDEF produces triangles $triangle ABC$ and $triangle DEF$. I would like to expand that command such that it can take any number of arguments and such that trianglesABCDEFGHIJKL produces triangles $triangle ABC$, $triangle DEF$, $triangle GHI$ and $triangle DEF$. I have seen a solution somewhere for a shoppinglist that makes use of makeatletter and some TeX command, but this is more difficult, I think, because before you add the current argument, you need to know whether it is the last argument (if not: put a comma, if yes: put "and").










share|improve this question









New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













This question already has an answer here:



  • Commands that may take a variable number of arguments

    3 answers



I have the following command: newcommandtriangles[2]triangles $triangle #1$ and $triangle #2, such that trianglesABCDEF produces triangles $triangle ABC$ and $triangle DEF$. I would like to expand that command such that it can take any number of arguments and such that trianglesABCDEFGHIJKL produces triangles $triangle ABC$, $triangle DEF$, $triangle GHI$ and $triangle DEF$. I have seen a solution somewhere for a shoppinglist that makes use of makeatletter and some TeX command, but this is more difficult, I think, because before you add the current argument, you need to know whether it is the last argument (if not: put a comma, if yes: put "and").





This question already has an answer here:



  • Commands that may take a variable number of arguments

    3 answers







macros






share|improve this question









New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 8 hours ago









egreg

729k8819273240




729k8819273240






New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 8 hours ago









BartBart

61




61




New contributor




Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Bart is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by KJO, JouleV, Dox, flav, Stefan Pinnow 6 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by KJO, JouleV, Dox, flav, Stefan Pinnow 6 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

    – Ulrich Diez
    3 hours ago

















  • For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

    – Ulrich Diez
    3 hours ago
















For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

– Ulrich Diez
3 hours ago





For the sake of unambiguity regarding the question which brace groups belong to triangles and which do not, I strongly recommend a syntax like trianglesABCDEFGHI. Or a syntax without brace-groups at all, as suggested by egreg, trianglesABC,DEF,GHI.

– Ulrich Diez
3 hours ago










2 Answers
2






active

oldest

votes


















3














Macros with a variable number of arguments are not the best thing to do with LaTeX; in your case it's simpler to use a comma separated list of triangles.



documentclassarticle
usepackagexparse

ExplSyntaxOn

NewDocumentCommandtrianglesm

bart_triangles:n #1


seq_new:N l__bart_triangles_seq
tl_new:N l__bart_triangles_item_tl

cs_new_protected:Nn bart_triangles:n

seq_clear:N l__bart_triangles_seq
clist_map_variable:nNn #1 l__bart_triangles_item_tl

__bart_triangles_add:V l__bart_triangles_item_tl

triangle
int_compare:nF seq_count:N l__bart_triangles_seq < 2 s
nobreakspace
seq_use:Nnnn l__bart_triangles_seq ~and~ ,~ ~and~


cs_new_protected:Nn __bart_triangles_add:n

seq_put_right:Nn l__bart_triangles_seq $triangle #1$

cs_generate_variant:Nn __bart_triangles_add:n V

ExplSyntaxOff

begindocument

trianglesABC

trianglesABC,DEF

trianglesABC,DEF,GHI

enddocument


The comma separated list is mapped and each item is added to a sequence in the form $triangle<vertices>$. Then the sequence is used, with the specified separators (between two, between more than two, between last two).



The “s” is added only if the list contains at least two items.



enter image description here






share|improve this answer






























    3














    The shoppinglist you're talking about is at Writing a LaTeX macro that takes a variable number of arguments.



    You can adapt it quickly to work with any number of triangles. The case with one triangle is also handled in order to only display "Triangle" instead of "Triangles".



    documentclass[11pt]article

    makeatletter
    newcommandtriangles[1]%
    checknextarg#1
    newcommandchecknextarg[1]%
    @ifnextcharbgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
    newcommandgobblenextarg[1]%
    @ifnextcharbgroup, $triangle #1$gobblenextarg and $triangle #1$
    makeatother

    begindocument

    trianglesABC

    trianglesABCDEF

    trianglesABCDEFGHI

    trianglesABCDEFGHIJKL

    enddocument


    This is the result obtained:



    Triangles



    EDIT



    Following the comment by Ulrich Diez, an improved version of this command would be:



    documentclass[11pt]article

    usepackageltxcmds

    makeatletter
    newcommandtriangles[1]%
    checknextarg#1
    newcommandchecknextarg[1]%
    ltx@ifnextchar@nospacebgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
    newcommandgobblenextarg[1]%
    ltx@ifnextchar@nospacebgroup, $triangle #1$gobblenextarg and $triangle #1$
    makeatother

    begindocument

    trianglesABC

    trianglesABCDEF

    trianglesABCDEFGHI

    trianglesABCDEFGHIJKL

    trianglesABCDEFGHIJKL Large This shall not be part of the command

    enddocument


    where ltx@ifnextchar@nospace does not skip space and prevent the text after the command to be interpreted as an "argument" of the command triangles.



    However, as stated in egreg's answer, this way of doing things should be avoided.






    share|improve this answer










    New contributor




    KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.















    • 1





      What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

      – Ulrich Diez
      3 hours ago

















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Macros with a variable number of arguments are not the best thing to do with LaTeX; in your case it's simpler to use a comma separated list of triangles.



    documentclassarticle
    usepackagexparse

    ExplSyntaxOn

    NewDocumentCommandtrianglesm

    bart_triangles:n #1


    seq_new:N l__bart_triangles_seq
    tl_new:N l__bart_triangles_item_tl

    cs_new_protected:Nn bart_triangles:n

    seq_clear:N l__bart_triangles_seq
    clist_map_variable:nNn #1 l__bart_triangles_item_tl

    __bart_triangles_add:V l__bart_triangles_item_tl

    triangle
    int_compare:nF seq_count:N l__bart_triangles_seq < 2 s
    nobreakspace
    seq_use:Nnnn l__bart_triangles_seq ~and~ ,~ ~and~


    cs_new_protected:Nn __bart_triangles_add:n

    seq_put_right:Nn l__bart_triangles_seq $triangle #1$

    cs_generate_variant:Nn __bart_triangles_add:n V

    ExplSyntaxOff

    begindocument

    trianglesABC

    trianglesABC,DEF

    trianglesABC,DEF,GHI

    enddocument


    The comma separated list is mapped and each item is added to a sequence in the form $triangle<vertices>$. Then the sequence is used, with the specified separators (between two, between more than two, between last two).



    The “s” is added only if the list contains at least two items.



    enter image description here






    share|improve this answer



























      3














      Macros with a variable number of arguments are not the best thing to do with LaTeX; in your case it's simpler to use a comma separated list of triangles.



      documentclassarticle
      usepackagexparse

      ExplSyntaxOn

      NewDocumentCommandtrianglesm

      bart_triangles:n #1


      seq_new:N l__bart_triangles_seq
      tl_new:N l__bart_triangles_item_tl

      cs_new_protected:Nn bart_triangles:n

      seq_clear:N l__bart_triangles_seq
      clist_map_variable:nNn #1 l__bart_triangles_item_tl

      __bart_triangles_add:V l__bart_triangles_item_tl

      triangle
      int_compare:nF seq_count:N l__bart_triangles_seq < 2 s
      nobreakspace
      seq_use:Nnnn l__bart_triangles_seq ~and~ ,~ ~and~


      cs_new_protected:Nn __bart_triangles_add:n

      seq_put_right:Nn l__bart_triangles_seq $triangle #1$

      cs_generate_variant:Nn __bart_triangles_add:n V

      ExplSyntaxOff

      begindocument

      trianglesABC

      trianglesABC,DEF

      trianglesABC,DEF,GHI

      enddocument


      The comma separated list is mapped and each item is added to a sequence in the form $triangle<vertices>$. Then the sequence is used, with the specified separators (between two, between more than two, between last two).



      The “s” is added only if the list contains at least two items.



      enter image description here






      share|improve this answer

























        3












        3








        3







        Macros with a variable number of arguments are not the best thing to do with LaTeX; in your case it's simpler to use a comma separated list of triangles.



        documentclassarticle
        usepackagexparse

        ExplSyntaxOn

        NewDocumentCommandtrianglesm

        bart_triangles:n #1


        seq_new:N l__bart_triangles_seq
        tl_new:N l__bart_triangles_item_tl

        cs_new_protected:Nn bart_triangles:n

        seq_clear:N l__bart_triangles_seq
        clist_map_variable:nNn #1 l__bart_triangles_item_tl

        __bart_triangles_add:V l__bart_triangles_item_tl

        triangle
        int_compare:nF seq_count:N l__bart_triangles_seq < 2 s
        nobreakspace
        seq_use:Nnnn l__bart_triangles_seq ~and~ ,~ ~and~


        cs_new_protected:Nn __bart_triangles_add:n

        seq_put_right:Nn l__bart_triangles_seq $triangle #1$

        cs_generate_variant:Nn __bart_triangles_add:n V

        ExplSyntaxOff

        begindocument

        trianglesABC

        trianglesABC,DEF

        trianglesABC,DEF,GHI

        enddocument


        The comma separated list is mapped and each item is added to a sequence in the form $triangle<vertices>$. Then the sequence is used, with the specified separators (between two, between more than two, between last two).



        The “s” is added only if the list contains at least two items.



        enter image description here






        share|improve this answer













        Macros with a variable number of arguments are not the best thing to do with LaTeX; in your case it's simpler to use a comma separated list of triangles.



        documentclassarticle
        usepackagexparse

        ExplSyntaxOn

        NewDocumentCommandtrianglesm

        bart_triangles:n #1


        seq_new:N l__bart_triangles_seq
        tl_new:N l__bart_triangles_item_tl

        cs_new_protected:Nn bart_triangles:n

        seq_clear:N l__bart_triangles_seq
        clist_map_variable:nNn #1 l__bart_triangles_item_tl

        __bart_triangles_add:V l__bart_triangles_item_tl

        triangle
        int_compare:nF seq_count:N l__bart_triangles_seq < 2 s
        nobreakspace
        seq_use:Nnnn l__bart_triangles_seq ~and~ ,~ ~and~


        cs_new_protected:Nn __bart_triangles_add:n

        seq_put_right:Nn l__bart_triangles_seq $triangle #1$

        cs_generate_variant:Nn __bart_triangles_add:n V

        ExplSyntaxOff

        begindocument

        trianglesABC

        trianglesABC,DEF

        trianglesABC,DEF,GHI

        enddocument


        The comma separated list is mapped and each item is added to a sequence in the form $triangle<vertices>$. Then the sequence is used, with the specified separators (between two, between more than two, between last two).



        The “s” is added only if the list contains at least two items.



        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 8 hours ago









        egregegreg

        729k8819273240




        729k8819273240





















            3














            The shoppinglist you're talking about is at Writing a LaTeX macro that takes a variable number of arguments.



            You can adapt it quickly to work with any number of triangles. The case with one triangle is also handled in order to only display "Triangle" instead of "Triangles".



            documentclass[11pt]article

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            @ifnextcharbgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            @ifnextcharbgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            enddocument


            This is the result obtained:



            Triangles



            EDIT



            Following the comment by Ulrich Diez, an improved version of this command would be:



            documentclass[11pt]article

            usepackageltxcmds

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            ltx@ifnextchar@nospacebgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            ltx@ifnextchar@nospacebgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            trianglesABCDEFGHIJKL Large This shall not be part of the command

            enddocument


            where ltx@ifnextchar@nospace does not skip space and prevent the text after the command to be interpreted as an "argument" of the command triangles.



            However, as stated in egreg's answer, this way of doing things should be avoided.






            share|improve this answer










            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.















            • 1





              What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

              – Ulrich Diez
              3 hours ago















            3














            The shoppinglist you're talking about is at Writing a LaTeX macro that takes a variable number of arguments.



            You can adapt it quickly to work with any number of triangles. The case with one triangle is also handled in order to only display "Triangle" instead of "Triangles".



            documentclass[11pt]article

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            @ifnextcharbgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            @ifnextcharbgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            enddocument


            This is the result obtained:



            Triangles



            EDIT



            Following the comment by Ulrich Diez, an improved version of this command would be:



            documentclass[11pt]article

            usepackageltxcmds

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            ltx@ifnextchar@nospacebgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            ltx@ifnextchar@nospacebgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            trianglesABCDEFGHIJKL Large This shall not be part of the command

            enddocument


            where ltx@ifnextchar@nospace does not skip space and prevent the text after the command to be interpreted as an "argument" of the command triangles.



            However, as stated in egreg's answer, this way of doing things should be avoided.






            share|improve this answer










            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.















            • 1





              What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

              – Ulrich Diez
              3 hours ago













            3












            3








            3







            The shoppinglist you're talking about is at Writing a LaTeX macro that takes a variable number of arguments.



            You can adapt it quickly to work with any number of triangles. The case with one triangle is also handled in order to only display "Triangle" instead of "Triangles".



            documentclass[11pt]article

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            @ifnextcharbgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            @ifnextcharbgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            enddocument


            This is the result obtained:



            Triangles



            EDIT



            Following the comment by Ulrich Diez, an improved version of this command would be:



            documentclass[11pt]article

            usepackageltxcmds

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            ltx@ifnextchar@nospacebgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            ltx@ifnextchar@nospacebgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            trianglesABCDEFGHIJKL Large This shall not be part of the command

            enddocument


            where ltx@ifnextchar@nospace does not skip space and prevent the text after the command to be interpreted as an "argument" of the command triangles.



            However, as stated in egreg's answer, this way of doing things should be avoided.






            share|improve this answer










            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            The shoppinglist you're talking about is at Writing a LaTeX macro that takes a variable number of arguments.



            You can adapt it quickly to work with any number of triangles. The case with one triangle is also handled in order to only display "Triangle" instead of "Triangles".



            documentclass[11pt]article

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            @ifnextcharbgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            @ifnextcharbgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            enddocument


            This is the result obtained:



            Triangles



            EDIT



            Following the comment by Ulrich Diez, an improved version of this command would be:



            documentclass[11pt]article

            usepackageltxcmds

            makeatletter
            newcommandtriangles[1]%
            checknextarg#1
            newcommandchecknextarg[1]%
            ltx@ifnextchar@nospacebgroupTriangles $triangle #1$gobblenextargTriangle $triangle #1$
            newcommandgobblenextarg[1]%
            ltx@ifnextchar@nospacebgroup, $triangle #1$gobblenextarg and $triangle #1$
            makeatother

            begindocument

            trianglesABC

            trianglesABCDEF

            trianglesABCDEFGHI

            trianglesABCDEFGHIJKL

            trianglesABCDEFGHIJKL Large This shall not be part of the command

            enddocument


            where ltx@ifnextchar@nospace does not skip space and prevent the text after the command to be interpreted as an "argument" of the command triangles.



            However, as stated in egreg's answer, this way of doing things should be avoided.







            share|improve this answer










            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer








            edited 2 hours ago





















            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 8 hours ago









            KersouManKersouMan

            1115




            1115




            New contributor




            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            KersouMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.







            • 1





              What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

              – Ulrich Diez
              3 hours ago












            • 1





              What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

              – Ulrich Diez
              3 hours ago







            1




            1





            What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

            – Ulrich Diez
            3 hours ago





            What about trianglesABCDEFGHIJKL large This shall not be part of the triangle-command ?

            – Ulrich Diez
            3 hours ago



            Popular posts from this blog

            Isurus Índice Especies | Notas | Véxase tamén | Menú de navegación"A compendium of fossil marine animal genera (Chondrichthyes entry)"o orixinal"A review of the Tertiary fossil Cetacea (Mammalia) localities in wales port taf Museum Victoria"o orixinalThe Vertebrate Fauna of the Selma Formation of Alabama. Part VII. Part VIII. The Mosasaurs The Fishes50419737IDsh85068767Isurus2548834613242066569678159923NHMSYS00210535017845105743

            Is 1 ppb equal to 1 μg/kg? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to determine the concentration after a dilution with Beer's law?What would be SMILES notation for a compound with delocalized bonding?Amount of substance of a molecule in a solute the same as amount of substance of constituent elements?Interpreting notation format 1.64E-02 from particulate emission dataWhat was the lithium concentration in 1940's 7-Up?Why are osmoles not considered SI units?Why is Ka constant when volume is increased?Should residual sodium be considered in measuring sodium content of sweat?Concentration of mercury in bodyConversion from a PPB value to µg/m3 of Isobutylene

            What does “fit” mean in this sentence? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How does 'jealousy' mean 'suspicion'?What does “not so say” mean?Does “somebody of my caliber” mean the speaker themselves?“accounting for high fasting blood glucose”- help about the meaningWhat does “cloaked by NDA” mean in this context?What does it mean by 'community ownership' in this context?What does “human corroborators” mean in this context?What does “everything but a fire” mean in this context?What does “run” mean here?What does “rabbited” mean/imply in this sentence?