In PStricks, what is the difference between psforeach and multido in the following?
My code:
documentclass[12pt,a4paper]{article}
usepackage{amsmath,amssymb,newcent}
usepackage{pstricks}
usepackage{multido}
usepackage{auto-pst-pdf}
begin{document}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
psforeach{m}{.5,1.5,2.5,3.5,4.5,5.5}{psline(0,m)(m,0)}
end{pspicture}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
multido{n=0.5+1}{6}{psline(0,n)(n,0)}
end{pspicture}
end{document}
The result compiling:
Question:
These commands are equivalent !?. Why are there differences?
pstricks multido
add a comment |
My code:
documentclass[12pt,a4paper]{article}
usepackage{amsmath,amssymb,newcent}
usepackage{pstricks}
usepackage{multido}
usepackage{auto-pst-pdf}
begin{document}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
psforeach{m}{.5,1.5,2.5,3.5,4.5,5.5}{psline(0,m)(m,0)}
end{pspicture}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
multido{n=0.5+1}{6}{psline(0,n)(n,0)}
end{pspicture}
end{document}
The result compiling:
Question:
These commands are equivalent !?. Why are there differences?
pstricks multido
add a comment |
My code:
documentclass[12pt,a4paper]{article}
usepackage{amsmath,amssymb,newcent}
usepackage{pstricks}
usepackage{multido}
usepackage{auto-pst-pdf}
begin{document}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
psforeach{m}{.5,1.5,2.5,3.5,4.5,5.5}{psline(0,m)(m,0)}
end{pspicture}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
multido{n=0.5+1}{6}{psline(0,n)(n,0)}
end{pspicture}
end{document}
The result compiling:
Question:
These commands are equivalent !?. Why are there differences?
pstricks multido
My code:
documentclass[12pt,a4paper]{article}
usepackage{amsmath,amssymb,newcent}
usepackage{pstricks}
usepackage{multido}
usepackage{auto-pst-pdf}
begin{document}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
psforeach{m}{.5,1.5,2.5,3.5,4.5,5.5}{psline(0,m)(m,0)}
end{pspicture}
begin{pspicture}(-.5,-1.5)(6.5,1.5)
multido{n=0.5+1}{6}{psline(0,n)(n,0)}
end{pspicture}
end{document}
The result compiling:
Question:
These commands are equivalent !?. Why are there differences?
pstricks multido
pstricks multido
asked Dec 8 at 9:39
chishimotoji
739215
739215
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
for equidistant values it makes no difference. But multido
cannot work with something like 1, 1, 2, 3, 5, 8, ...
and, of course, multido
uses some predefined macros:
i for integers
n for natural numbers
r for real
In your example it should be
multido{r=0.5+1}{6}{psline[linecolor=red](0,r)(r,0)}
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
formultido
everything is declared in the documentation. Forpsforeach
you can use any macro you like and which is not already defined.
– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
|
show 2 more comments
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%2f463782%2fin-pstricks-what-is-the-difference-between-psforeach-and-multido-in-the-follo%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
for equidistant values it makes no difference. But multido
cannot work with something like 1, 1, 2, 3, 5, 8, ...
and, of course, multido
uses some predefined macros:
i for integers
n for natural numbers
r for real
In your example it should be
multido{r=0.5+1}{6}{psline[linecolor=red](0,r)(r,0)}
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
formultido
everything is declared in the documentation. Forpsforeach
you can use any macro you like and which is not already defined.
– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
|
show 2 more comments
for equidistant values it makes no difference. But multido
cannot work with something like 1, 1, 2, 3, 5, 8, ...
and, of course, multido
uses some predefined macros:
i for integers
n for natural numbers
r for real
In your example it should be
multido{r=0.5+1}{6}{psline[linecolor=red](0,r)(r,0)}
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
formultido
everything is declared in the documentation. Forpsforeach
you can use any macro you like and which is not already defined.
– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
|
show 2 more comments
for equidistant values it makes no difference. But multido
cannot work with something like 1, 1, 2, 3, 5, 8, ...
and, of course, multido
uses some predefined macros:
i for integers
n for natural numbers
r for real
In your example it should be
multido{r=0.5+1}{6}{psline[linecolor=red](0,r)(r,0)}
for equidistant values it makes no difference. But multido
cannot work with something like 1, 1, 2, 3, 5, 8, ...
and, of course, multido
uses some predefined macros:
i for integers
n for natural numbers
r for real
In your example it should be
multido{r=0.5+1}{6}{psline[linecolor=red](0,r)(r,0)}
edited Dec 8 at 11:05
answered Dec 8 at 10:40
Herbert
269k24408717
269k24408717
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
formultido
everything is declared in the documentation. Forpsforeach
you can use any macro you like and which is not already defined.
– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
|
show 2 more comments
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
formultido
everything is declared in the documentation. Forpsforeach
you can use any macro you like and which is not already defined.
– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
In above question, multido{n=0.5+1}{6}, it has also equidistant values. So, can you explain more clearly?
– chishimotoji
Dec 8 at 10:55
see edited answer
– Herbert
Dec 8 at 11:05
see edited answer
– Herbert
Dec 8 at 11:05
for
multido
everything is declared in the documentation. For psforeach
you can use any macro you like and which is not already defined.– Herbert
Dec 8 at 11:27
for
multido
everything is declared in the documentation. For psforeach
you can use any macro you like and which is not already defined.– Herbert
Dec 8 at 11:27
please answer the above question!
– chishimotoji
Dec 8 at 11:29
please answer the above question!
– chishimotoji
Dec 8 at 11:29
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
@chishimotoji you can use for example multido{ri=0.5+1}{6}{psline(0,ri)(ri,0)} or multido{ra=0.5+1}{6}{psline(0,ra)(ra,0)}
– Thomas
Dec 8 at 12:09
|
show 2 more comments
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463782%2fin-pstricks-what-is-the-difference-between-psforeach-and-multido-in-the-follo%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