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
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
add a comment |
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
add a comment |
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
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
macros foreach parameters
asked 2 mins ago
Vinccool96Vinccool96
1819
1819
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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