Newcommand that uncludes a foreach with unknown number of parameters
Wrapping homogeneous Python objects
In the 1924 version of The Thief of Bagdad, no character is named, right?
Comment Box for Substitution Method of Integrals
Does the attack bonus from a Masterwork weapon stack with the attack bonus from Masterwork ammunition?
Can other pieces capture a threatening piece and prevent a checkmate?
Violin - Can double stops be played when the strings are not next to each other?
Maths symbols and unicode-math input inside siunitx commands
Print a physical multiplication table
How to terminate ping <dest> &
How can my new character avoid being a role-playing handicap to the party?
Generic TVP tradeoffs?
What favor did Moody owe Dumbledore?
Knife as defense against stray dogs
Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?
What does Deadpool mean by "left the house in that shirt"?
Worshiping one God at a time?
Asserting that Atheism and Theism are both faith based positions
Why is indicated airspeed rather than ground speed used during the takeoff roll?
Writing in a Christian voice
How to define limit operations in general topological spaces? Are nets able to do this?
What is the significance behind "40 days" that often appears in the Bible?
Variable completely messes up echoed string
Tikz: place node leftmost of two nodes of different widths
How are passwords stolen from companies if they only store hashes?
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}
usepackage{tikz}
makeatletter
newcommand{foreachlinedo}[2]{foreach noeud in {listerfe#1} {draw[<-] (#2.east) -| ++(-1em,0em) |- (noeud.west);}}
newcommand{listerfe}[1]{#1listerfenextarg}
newcommand{listerfenextarg}{@ifnextcharbgroup{listerfegobblenextarg}{}}
newcommand{listerfegobblenextarg}[1]{,#1@ifnextcharbgroup{listerfegobblenextarg}{}}
makeatother
begin{document}
definecolor{couleurbackintr}{HTML}{7F00FF}
definecolor{couleurtextintr}{HTML}{FFFFFF}
definecolor{couleurbackfonc}{HTML}{C780FF}
definecolor{couleurtext}{HTML}{000000}
definecolor{couleurbackextr}{HTML}{DDB3FF}
begin{figure}[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}
}
begin{tikzpicture}[]
fontsize{8}{9} 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}; & & \
};
foreachlinedo{{forcutil}{defailla}{poissons}}{instcapt};
end{tikzpicture}
caption{Diagramme fonctionnel}
label{f:caf_diag_fonc}
end{figure}
end{document}
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 }. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before XC@definec@lor was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before tikz@@scan@@no@calculator was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{figure}
begin{figure} on input line 30 ended by end{document}. end{document}
You can't use `end' in internal vertical mode. end{document}
begin{figure} on input line 30 ended by end{document}. end{document}
Missing } inserted. end{document}
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}
usepackage{tikz}
makeatletter
newcommand{foreachlinedo}[2]{foreach noeud in {listerfe#1} {draw[<-] (#2.east) -| ++(-1em,0em) |- (noeud.west);}}
newcommand{listerfe}[1]{#1listerfenextarg}
newcommand{listerfenextarg}{@ifnextcharbgroup{listerfegobblenextarg}{}}
newcommand{listerfegobblenextarg}[1]{,#1@ifnextcharbgroup{listerfegobblenextarg}{}}
makeatother
begin{document}
definecolor{couleurbackintr}{HTML}{7F00FF}
definecolor{couleurtextintr}{HTML}{FFFFFF}
definecolor{couleurbackfonc}{HTML}{C780FF}
definecolor{couleurtext}{HTML}{000000}
definecolor{couleurbackextr}{HTML}{DDB3FF}
begin{figure}[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}
}
begin{tikzpicture}[]
fontsize{8}{9} 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}; & & \
};
foreachlinedo{{forcutil}{defailla}{poissons}}{instcapt};
end{tikzpicture}
caption{Diagramme fonctionnel}
label{f:caf_diag_fonc}
end{figure}
end{document}
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 }. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before XC@definec@lor was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before tikz@@scan@@no@calculator was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{figure}
begin{figure} on input line 30 ended by end{document}. end{document}
You can't use `end' in internal vertical mode. end{document}
begin{figure} on input line 30 ended by end{document}. end{document}
Missing } inserted. end{document}
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}
usepackage{tikz}
makeatletter
newcommand{foreachlinedo}[2]{foreach noeud in {listerfe#1} {draw[<-] (#2.east) -| ++(-1em,0em) |- (noeud.west);}}
newcommand{listerfe}[1]{#1listerfenextarg}
newcommand{listerfenextarg}{@ifnextcharbgroup{listerfegobblenextarg}{}}
newcommand{listerfegobblenextarg}[1]{,#1@ifnextcharbgroup{listerfegobblenextarg}{}}
makeatother
begin{document}
definecolor{couleurbackintr}{HTML}{7F00FF}
definecolor{couleurtextintr}{HTML}{FFFFFF}
definecolor{couleurbackfonc}{HTML}{C780FF}
definecolor{couleurtext}{HTML}{000000}
definecolor{couleurbackextr}{HTML}{DDB3FF}
begin{figure}[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}
}
begin{tikzpicture}[]
fontsize{8}{9} 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}; & & \
};
foreachlinedo{{forcutil}{defailla}{poissons}}{instcapt};
end{tikzpicture}
caption{Diagramme fonctionnel}
label{f:caf_diag_fonc}
end{figure}
end{document}
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 }. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before XC@definec@lor was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before tikz@@scan@@no@calculator was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{figure}
begin{figure} on input line 30 ended by end{document}. end{document}
You can't use `end' in internal vertical mode. end{document}
begin{figure} on input line 30 ended by end{document}. end{document}
Missing } inserted. end{document}
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}
usepackage{tikz}
makeatletter
newcommand{foreachlinedo}[2]{foreach noeud in {listerfe#1} {draw[<-] (#2.east) -| ++(-1em,0em) |- (noeud.west);}}
newcommand{listerfe}[1]{#1listerfenextarg}
newcommand{listerfenextarg}{@ifnextcharbgroup{listerfegobblenextarg}{}}
newcommand{listerfegobblenextarg}[1]{,#1@ifnextcharbgroup{listerfegobblenextarg}{}}
makeatother
begin{document}
definecolor{couleurbackintr}{HTML}{7F00FF}
definecolor{couleurtextintr}{HTML}{FFFFFF}
definecolor{couleurbackfonc}{HTML}{C780FF}
definecolor{couleurtext}{HTML}{000000}
definecolor{couleurbackextr}{HTML}{DDB3FF}
begin{figure}[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}
}
begin{tikzpicture}[]
fontsize{8}{9} 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}; & & \
};
foreachlinedo{{forcutil}{defailla}{poissons}}{instcapt};
end{tikzpicture}
caption{Diagramme fonctionnel}
label{f:caf_diag_fonc}
end{figure}
end{document}
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 }. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before XC@definec@lor was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Paragraph ended before tikz@@scan@@no@calculator was complete. ...{{forcutil}{defailla}{poissons}}{instcapt}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{tikzpicture}
Missing } inserted. end{tikzpicture}
Extra }, or forgotten endgroup. end{figure}
begin{figure} on input line 30 ended by end{document}. end{document}
You can't use `end' in internal vertical mode. end{document}
begin{figure} on input line 30 ended by end{document}. end{document}
Missing } inserted. end{document}
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 3 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');
});
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');
});
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');
});
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');
});
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');
});
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