Newcommand that uncludes a foreach with unknown number of parameters

In what cases must I use 了 and in what cases not?

Does the attack bonus from a Masterwork weapon stack with the attack bonus from Masterwork ammunition?

How to get the n-th line after a grepped one?

Can you move over difficult terrain with only 5 feet of movement?

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

How can an organ that provides biological immortality be unable to regenerate?

Unfrosted light bulb

Fewest number of steps to reach 200 using special calculator

Does .bashrc contain syntax errors?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

Deletion of copy-ctor & copy-assignment - public, private or protected?

PTIJ What is the inyan of the Konami code in Uncle Moishy's song?

Describing a chess game in a novel

Am I eligible for the Eurail Youth pass? I am 27.5 years old

Tikz: place node leftmost of two nodes of different widths

What are substitutions for coconut in curry?

Synchronized implementation of a bank account in Java

What favor did Moody owe Dumbledore?

Practical application of matrices and determinants

A Ri-diddley-iley Riddle

How does one measure the Fourier components of a signal?

Do US professors/group leaders only get a salary, but no group budget?

Have the tides ever turned twice on any open problem?

Variable completely messes up echoed string



Newcommand that uncludes a foreach with unknown number of parameters














0















Sorry, but part of the code is in French. However, it won't matter because it's only the listed text



I currently have a new command named listerfe that, combined with listerfenextarg and listerfegobblenextarg, succesfully proceeds an unknown number of parameters to separe them with a ,



Now, I have this code:



% !TeX encoding = UTF-8
% !TeX spellcheck = fr_FR


documentclass[utf8]article
usepackagetikz
makeatletter
newcommandforeachlinedo[2]foreach noeud in listerfe#1 ++(-1em,0em)

newcommandlisterfe[1]#1listerfenextarg
newcommandlisterfenextarg@ifnextcharbgrouplisterfegobblenextarg
newcommandlisterfegobblenextarg[1],#1@ifnextcharbgrouplisterfegobblenextarg
makeatother

begindocument

definecolorcouleurbackintrHTML7F00FF
definecolorcouleurtextintrHTMLFFFFFF
definecolorcouleurbackfoncHTMLC780FF
definecolorcouleurtextHTML000000
definecolorcouleurbackextrHTMLDDB3FF
beginfigure[htp]
centering
tikzset
basic/.style=draw, rounded corners=2pt, thick, text width=8em, align=flush center, text=couleurtext, node distance=2em,
intrant/.style=basic, fill=couleurbackintr, text=couleurtextintr,
fonction/.style=basic, fill=couleurbackfonc,
extrant/.style=basic, fill=couleurbackextr

begintikzpicture[]
fontsize89 selectfont
% intrants
matrix[row sep=2em, column sep=2em]
% 1re ligne
%TODO changer nom
node[intrant](forcutil)Force utilisée; & node[fonction](instcapt)Installer capteur sous l'eau; & & & node[extrant](captinst)Capteur installé; \
% 2me ligne
node[intrant](defailla)Défaillance; & node[fonction](detcdefa)Détecter défaillance; & & node[fonction](genralrm)Générer alarme; & node[extrant](alarme)Alarme; \
node[intrant](poissons)Poissons; & node[fonction](detecteu)Détecteur; & node[fonction](photo)Photo; & node[fonction](accudonn)Accumuler données; & \
node[intrant](elecbatt)Électicité batterie; & node[fonction](alimcapt)Alimenter capteur; & & node[fonction](idenpois)Identifier poisson; & \
node[intrant](tempreau)Température de l'eau; & node[fonction](captteau)Capteur température eau; & & node[fonction](archdonn)Archiver donnéees; & node[extrant](donnarch)Données archivées; \
node[intrant](tempintr)Température interne; & node[fonction](capttcpt)Capteur température interne; & & & \
node[intrant](confvolm)Configuration volume; & node[fonction](confcapt)Configurer capteur; & & & \
node[intrant](entrutil)Entrées utilisateurs; & node[fonction](authutil)Authentifier utilisateur; & node[fonction](accedonn)Accéder aux données; & & \
;
foreachlinedoforcutildefaillapoissonsinstcapt;
endtikzpicture
captionDiagramme fonctionnel
labelf:caf_diag_fonc
endfigure

enddocument


Without the foreachlinedo, so without arrows, it looks like this:





Now, when I run this code, it tells me this:



Argument of XC@definec@lor has an extra }. ...forcutildefaillapoissonsinstcapt
Paragraph ended before XC@definec@lor was complete. ...forcutildefaillapoissonsinstcapt
Paragraph ended before tikz@@scan@@no@calculator was complete. ...forcutildefaillapoissonsinstcapt
Extra }, or forgotten endgroup. endtikzpicture
Missing } inserted. endtikzpicture
Extra }, or forgotten endgroup. endtikzpicture
Missing } inserted. endtikzpicture
Extra }, or forgotten endgroup. endfigure
beginfigure on input line 30 ended by enddocument. enddocument
You can't use `end' in internal vertical mode. enddocument
beginfigure on input line 30 ended by enddocument. enddocument
Missing } inserted. enddocument
Emergency stop.
Unused global option(s): [utf8]. % doesn't matter


I created foreachlinedo because I don't want to create lots of foreach, because there will be lots and lots of arrows combined inthe diagram.



How can I make it work?









share


























    0















    Sorry, but part of the code is in French. However, it won't matter because it's only the listed text



    I currently have a new command named listerfe that, combined with listerfenextarg and listerfegobblenextarg, succesfully proceeds an unknown number of parameters to separe them with a ,



    Now, I have this code:



    % !TeX encoding = UTF-8
    % !TeX spellcheck = fr_FR


    documentclass[utf8]article
    usepackagetikz
    makeatletter
    newcommandforeachlinedo[2]foreach noeud in listerfe#1 ++(-1em,0em)

    newcommandlisterfe[1]#1listerfenextarg
    newcommandlisterfenextarg@ifnextcharbgrouplisterfegobblenextarg
    newcommandlisterfegobblenextarg[1],#1@ifnextcharbgrouplisterfegobblenextarg
    makeatother

    begindocument

    definecolorcouleurbackintrHTML7F00FF
    definecolorcouleurtextintrHTMLFFFFFF
    definecolorcouleurbackfoncHTMLC780FF
    definecolorcouleurtextHTML000000
    definecolorcouleurbackextrHTMLDDB3FF
    beginfigure[htp]
    centering
    tikzset
    basic/.style=draw, rounded corners=2pt, thick, text width=8em, align=flush center, text=couleurtext, node distance=2em,
    intrant/.style=basic, fill=couleurbackintr, text=couleurtextintr,
    fonction/.style=basic, fill=couleurbackfonc,
    extrant/.style=basic, fill=couleurbackextr

    begintikzpicture[]
    fontsize89 selectfont
    % intrants
    matrix[row sep=2em, column sep=2em]
    % 1re ligne
    %TODO changer nom
    node[intrant](forcutil)Force utilisée; & node[fonction](instcapt)Installer capteur sous l'eau; & & & node[extrant](captinst)Capteur installé; \
    % 2me ligne
    node[intrant](defailla)Défaillance; & node[fonction](detcdefa)Détecter défaillance; & & node[fonction](genralrm)Générer alarme; & node[extrant](alarme)Alarme; \
    node[intrant](poissons)Poissons; & node[fonction](detecteu)Détecteur; & node[fonction](photo)Photo; & node[fonction](accudonn)Accumuler données; & \
    node[intrant](elecbatt)Électicité batterie; & node[fonction](alimcapt)Alimenter capteur; & & node[fonction](idenpois)Identifier poisson; & \
    node[intrant](tempreau)Température de l'eau; & node[fonction](captteau)Capteur température eau; & & node[fonction](archdonn)Archiver donnéees; & node[extrant](donnarch)Données archivées; \
    node[intrant](tempintr)Température interne; & node[fonction](capttcpt)Capteur température interne; & & & \
    node[intrant](confvolm)Configuration volume; & node[fonction](confcapt)Configurer capteur; & & & \
    node[intrant](entrutil)Entrées utilisateurs; & node[fonction](authutil)Authentifier utilisateur; & node[fonction](accedonn)Accéder aux données; & & \
    ;
    foreachlinedoforcutildefaillapoissonsinstcapt;
    endtikzpicture
    captionDiagramme fonctionnel
    labelf:caf_diag_fonc
    endfigure

    enddocument


    Without the foreachlinedo, so without arrows, it looks like this:





    Now, when I run this code, it tells me this:



    Argument of XC@definec@lor has an extra }. ...forcutildefaillapoissonsinstcapt
    Paragraph ended before XC@definec@lor was complete. ...forcutildefaillapoissonsinstcapt
    Paragraph ended before tikz@@scan@@no@calculator was complete. ...forcutildefaillapoissonsinstcapt
    Extra }, or forgotten endgroup. endtikzpicture
    Missing } inserted. endtikzpicture
    Extra }, or forgotten endgroup. endtikzpicture
    Missing } inserted. endtikzpicture
    Extra }, or forgotten endgroup. endfigure
    beginfigure on input line 30 ended by enddocument. enddocument
    You can't use `end' in internal vertical mode. enddocument
    beginfigure on input line 30 ended by enddocument. enddocument
    Missing } inserted. enddocument
    Emergency stop.
    Unused global option(s): [utf8]. % doesn't matter


    I created foreachlinedo because I don't want to create lots of foreach, because there will be lots and lots of arrows combined inthe diagram.



    How can I make it work?









    share
























      0












      0








      0








      Sorry, but part of the code is in French. However, it won't matter because it's only the listed text



      I currently have a new command named listerfe that, combined with listerfenextarg and listerfegobblenextarg, succesfully proceeds an unknown number of parameters to separe them with a ,



      Now, I have this code:



      % !TeX encoding = UTF-8
      % !TeX spellcheck = fr_FR


      documentclass[utf8]article
      usepackagetikz
      makeatletter
      newcommandforeachlinedo[2]foreach noeud in listerfe#1 ++(-1em,0em)

      newcommandlisterfe[1]#1listerfenextarg
      newcommandlisterfenextarg@ifnextcharbgrouplisterfegobblenextarg
      newcommandlisterfegobblenextarg[1],#1@ifnextcharbgrouplisterfegobblenextarg
      makeatother

      begindocument

      definecolorcouleurbackintrHTML7F00FF
      definecolorcouleurtextintrHTMLFFFFFF
      definecolorcouleurbackfoncHTMLC780FF
      definecolorcouleurtextHTML000000
      definecolorcouleurbackextrHTMLDDB3FF
      beginfigure[htp]
      centering
      tikzset
      basic/.style=draw, rounded corners=2pt, thick, text width=8em, align=flush center, text=couleurtext, node distance=2em,
      intrant/.style=basic, fill=couleurbackintr, text=couleurtextintr,
      fonction/.style=basic, fill=couleurbackfonc,
      extrant/.style=basic, fill=couleurbackextr

      begintikzpicture[]
      fontsize89 selectfont
      % intrants
      matrix[row sep=2em, column sep=2em]
      % 1re ligne
      %TODO changer nom
      node[intrant](forcutil)Force utilisée; & node[fonction](instcapt)Installer capteur sous l'eau; & & & node[extrant](captinst)Capteur installé; \
      % 2me ligne
      node[intrant](defailla)Défaillance; & node[fonction](detcdefa)Détecter défaillance; & & node[fonction](genralrm)Générer alarme; & node[extrant](alarme)Alarme; \
      node[intrant](poissons)Poissons; & node[fonction](detecteu)Détecteur; & node[fonction](photo)Photo; & node[fonction](accudonn)Accumuler données; & \
      node[intrant](elecbatt)Électicité batterie; & node[fonction](alimcapt)Alimenter capteur; & & node[fonction](idenpois)Identifier poisson; & \
      node[intrant](tempreau)Température de l'eau; & node[fonction](captteau)Capteur température eau; & & node[fonction](archdonn)Archiver donnéees; & node[extrant](donnarch)Données archivées; \
      node[intrant](tempintr)Température interne; & node[fonction](capttcpt)Capteur température interne; & & & \
      node[intrant](confvolm)Configuration volume; & node[fonction](confcapt)Configurer capteur; & & & \
      node[intrant](entrutil)Entrées utilisateurs; & node[fonction](authutil)Authentifier utilisateur; & node[fonction](accedonn)Accéder aux données; & & \
      ;
      foreachlinedoforcutildefaillapoissonsinstcapt;
      endtikzpicture
      captionDiagramme fonctionnel
      labelf:caf_diag_fonc
      endfigure

      enddocument


      Without the foreachlinedo, so without arrows, it looks like this:





      Now, when I run this code, it tells me this:



      Argument of XC@definec@lor has an extra }. ...forcutildefaillapoissonsinstcapt
      Paragraph ended before XC@definec@lor was complete. ...forcutildefaillapoissonsinstcapt
      Paragraph ended before tikz@@scan@@no@calculator was complete. ...forcutildefaillapoissonsinstcapt
      Extra }, or forgotten endgroup. endtikzpicture
      Missing } inserted. endtikzpicture
      Extra }, or forgotten endgroup. endtikzpicture
      Missing } inserted. endtikzpicture
      Extra }, or forgotten endgroup. endfigure
      beginfigure on input line 30 ended by enddocument. enddocument
      You can't use `end' in internal vertical mode. enddocument
      beginfigure on input line 30 ended by enddocument. enddocument
      Missing } inserted. enddocument
      Emergency stop.
      Unused global option(s): [utf8]. % doesn't matter


      I created foreachlinedo because I don't want to create lots of foreach, because there will be lots and lots of arrows combined inthe diagram.



      How can I make it work?









      share














      Sorry, but part of the code is in French. However, it won't matter because it's only the listed text



      I currently have a new command named listerfe that, combined with listerfenextarg and listerfegobblenextarg, succesfully proceeds an unknown number of parameters to separe them with a ,



      Now, I have this code:



      % !TeX encoding = UTF-8
      % !TeX spellcheck = fr_FR


      documentclass[utf8]article
      usepackagetikz
      makeatletter
      newcommandforeachlinedo[2]foreach noeud in listerfe#1 ++(-1em,0em)

      newcommandlisterfe[1]#1listerfenextarg
      newcommandlisterfenextarg@ifnextcharbgrouplisterfegobblenextarg
      newcommandlisterfegobblenextarg[1],#1@ifnextcharbgrouplisterfegobblenextarg
      makeatother

      begindocument

      definecolorcouleurbackintrHTML7F00FF
      definecolorcouleurtextintrHTMLFFFFFF
      definecolorcouleurbackfoncHTMLC780FF
      definecolorcouleurtextHTML000000
      definecolorcouleurbackextrHTMLDDB3FF
      beginfigure[htp]
      centering
      tikzset
      basic/.style=draw, rounded corners=2pt, thick, text width=8em, align=flush center, text=couleurtext, node distance=2em,
      intrant/.style=basic, fill=couleurbackintr, text=couleurtextintr,
      fonction/.style=basic, fill=couleurbackfonc,
      extrant/.style=basic, fill=couleurbackextr

      begintikzpicture[]
      fontsize89 selectfont
      % intrants
      matrix[row sep=2em, column sep=2em]
      % 1re ligne
      %TODO changer nom
      node[intrant](forcutil)Force utilisée; & node[fonction](instcapt)Installer capteur sous l'eau; & & & node[extrant](captinst)Capteur installé; \
      % 2me ligne
      node[intrant](defailla)Défaillance; & node[fonction](detcdefa)Détecter défaillance; & & node[fonction](genralrm)Générer alarme; & node[extrant](alarme)Alarme; \
      node[intrant](poissons)Poissons; & node[fonction](detecteu)Détecteur; & node[fonction](photo)Photo; & node[fonction](accudonn)Accumuler données; & \
      node[intrant](elecbatt)Électicité batterie; & node[fonction](alimcapt)Alimenter capteur; & & node[fonction](idenpois)Identifier poisson; & \
      node[intrant](tempreau)Température de l'eau; & node[fonction](captteau)Capteur température eau; & & node[fonction](archdonn)Archiver donnéees; & node[extrant](donnarch)Données archivées; \
      node[intrant](tempintr)Température interne; & node[fonction](capttcpt)Capteur température interne; & & & \
      node[intrant](confvolm)Configuration volume; & node[fonction](confcapt)Configurer capteur; & & & \
      node[intrant](entrutil)Entrées utilisateurs; & node[fonction](authutil)Authentifier utilisateur; & node[fonction](accedonn)Accéder aux données; & & \
      ;
      foreachlinedoforcutildefaillapoissonsinstcapt;
      endtikzpicture
      captionDiagramme fonctionnel
      labelf:caf_diag_fonc
      endfigure

      enddocument


      Without the foreachlinedo, so without arrows, it looks like this:





      Now, when I run this code, it tells me this:



      Argument of XC@definec@lor has an extra }. ...forcutildefaillapoissonsinstcapt
      Paragraph ended before XC@definec@lor was complete. ...forcutildefaillapoissonsinstcapt
      Paragraph ended before tikz@@scan@@no@calculator was complete. ...forcutildefaillapoissonsinstcapt
      Extra }, or forgotten endgroup. endtikzpicture
      Missing } inserted. endtikzpicture
      Extra }, or forgotten endgroup. endtikzpicture
      Missing } inserted. endtikzpicture
      Extra }, or forgotten endgroup. endfigure
      beginfigure on input line 30 ended by enddocument. enddocument
      You can't use `end' in internal vertical mode. enddocument
      beginfigure on input line 30 ended by enddocument. enddocument
      Missing } inserted. enddocument
      Emergency stop.
      Unused global option(s): [utf8]. % doesn't matter


      I created foreachlinedo because I don't want to create lots of foreach, because there will be lots and lots of arrows combined inthe diagram.



      How can I make it work?







      macros foreach parameters





      share












      share










      share



      share










      asked 2 mins ago









      Vinccool96Vinccool96

      1819




      1819




















          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%2f480011%2fnewcommand-that-uncludes-a-foreach-with-unknown-number-of-parameters%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%2f480011%2fnewcommand-that-uncludes-a-foreach-with-unknown-number-of-parameters%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

          How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

          152 Atala Notae | Nexus externi | Tabula navigationis"Discovery Circumstances: Numbered Minor Planets"2000152Small-Body Database

          Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"