Undefined control sequence error?
I am playing with the code adapted from here.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreac x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in #2{%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
When I compile, I am getting following error without output. Can anybody help with this?
ERROR: Undefined control sequence.
--- TeX said ---
trigram ...-- (1.1,3) -- (0,0) -- cycle; foreac
x [count=xx starting fro...l.23 trigram{0}{b,w,w}
;
tikz-pgf
add a comment |
I am playing with the code adapted from here.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreac x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in #2{%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
When I compile, I am getting following error without output. Can anybody help with this?
ERROR: Undefined control sequence.
--- TeX said ---
trigram ...-- (1.1,3) -- (0,0) -- cycle; foreac
x [count=xx starting fro...l.23 trigram{0}{b,w,w}
;
tikz-pgf
3
Welcome to TeX.SE! You have a typo in the code. It'sforeach
, notforeac
.
– Phelype Oleinik
Jan 24 at 20:18
add a comment |
I am playing with the code adapted from here.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreac x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in #2{%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
When I compile, I am getting following error without output. Can anybody help with this?
ERROR: Undefined control sequence.
--- TeX said ---
trigram ...-- (1.1,3) -- (0,0) -- cycle; foreac
x [count=xx starting fro...l.23 trigram{0}{b,w,w}
;
tikz-pgf
I am playing with the code adapted from here.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreac x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in #2{%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
When I compile, I am getting following error without output. Can anybody help with this?
ERROR: Undefined control sequence.
--- TeX said ---
trigram ...-- (1.1,3) -- (0,0) -- cycle; foreac
x [count=xx starting fro...l.23 trigram{0}{b,w,w}
;
tikz-pgf
tikz-pgf
asked Jan 24 at 20:17
Tony TanTony Tan
1116
1116
3
Welcome to TeX.SE! You have a typo in the code. It'sforeach
, notforeac
.
– Phelype Oleinik
Jan 24 at 20:18
add a comment |
3
Welcome to TeX.SE! You have a typo in the code. It'sforeach
, notforeac
.
– Phelype Oleinik
Jan 24 at 20:18
3
3
Welcome to TeX.SE! You have a typo in the code. It's
foreach
, not foreac
.– Phelype Oleinik
Jan 24 at 20:18
Welcome to TeX.SE! You have a typo in the code. It's
foreach
, not foreac
.– Phelype Oleinik
Jan 24 at 20:18
add a comment |
1 Answer
1
active
oldest
votes
You spelled foreach
wrong and you are missing a set of braces around #2
.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreach x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in {#2} {%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
@TonyTan You can also leave out the braces around#2
, but then you have to usetrigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
add a comment |
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%2f471722%2fundefined-control-sequence-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You spelled foreach
wrong and you are missing a set of braces around #2
.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreach x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in {#2} {%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
@TonyTan You can also leave out the braces around#2
, but then you have to usetrigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
add a comment |
You spelled foreach
wrong and you are missing a set of braces around #2
.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreach x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in {#2} {%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
@TonyTan You can also leave out the braces around#2
, but then you have to usetrigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
add a comment |
You spelled foreach
wrong and you are missing a set of braces around #2
.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreach x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in {#2} {%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
You spelled foreach
wrong and you are missing a set of braces around #2
.
documentclass{article}
usepackage{tikz}
tikzset{
nodeline/.style={midway, rotate=#1, minimum height=3.5mm, minimum width=2.5mm},
}
newcommandtrigram[2]{%
begin{scope}[rotate=#1]% around={#1:(0,0)}
defalenanno{w} %if it is ying
clip (-1.1,3) -- (1.1,3) -- (0,0) -- cycle;
foreach x [count=xx starting from 0, evaluate=xx as y using (1.75+.5*xx)] in {#2} {%
ifxxalenanno
draw[line width=3mm] (-1.2,y) -- (1.2,y) node[nodeline=#1,fill=white] {};
else
draw[line width=3mm] (-1.2,y) -- (1.2,y);
fi
}
end{scope}
}
begin{document}
begin{tikzpicture}
trigram{0}{b,w,w};
end{tikzpicture}
end{document}
answered Jan 24 at 20:23
Henri MenkeHenri Menke
72.6k8160270
72.6k8160270
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
@TonyTan You can also leave out the braces around#2
, but then you have to usetrigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
add a comment |
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
@TonyTan You can also leave out the braces around#2
, but then you have to usetrigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
Thanks for the quick fix. I messed up the spelling for foreach. But the curly bracket was the devil!
– Tony Tan
Jan 24 at 20:42
1
1
@TonyTan You can also leave out the braces around
#2
, but then you have to use trigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@TonyTan You can also leave out the braces around
#2
, but then you have to use trigram{0}{{b,w,w}};
– Henri Menke
Jan 24 at 20:56
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
@marmot Sorry but I no longer waste my time drawing other people's pictures.
– Henri Menke
Jan 24 at 22:53
add a comment |
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%2f471722%2fundefined-control-sequence-error%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
3
Welcome to TeX.SE! You have a typo in the code. It's
foreach
, notforeac
.– Phelype Oleinik
Jan 24 at 20:18