foreach iterates through list as one argument? - Help pleaseUsing Alph on foreach loop argumentHow to get...

A reference to a well-known characterization of scattered compact spaces

What exploit are these user agents trying to use?

Did Shadowfax go to Valinor?

How do conventional missiles fly?

Is Lorentz symmetry broken if SUSY is broken?

Watching something be written to a file live with tail

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Should I tell management that I intend to leave due to bad software development practices?

What do you call someone who asks many questions?

Why does Arabsat 6A need a Falcon Heavy to launch

Is it canonical bit space?

Why can't we play rap on piano?

Emailing HOD to enhance faculty application

Assassin's bullet with mercury

What mechanic is there to disable a threat instead of killing it?

Do I have a twin with permutated remainders?

SSH "lag" in LAN on some machines, mixed distros

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Facing a paradox: Earnshaw's theorem in one dimension

How to take photos in burst mode, without vibration?

Can I ask the recruiters in my resume to put the reason why I am rejected?

How can I make my BBEG immortal short of making them a Lich or Vampire?

Will google still index a page if I use a $_SESSION variable?

Could gravitational lensing be used to protect a spaceship from a laser?



foreach iterates through list as one argument? - Help please


Using Alph on foreach loop argumentHow to get language dependent quotation marks in citations with biblatex?TikZ: foreach in macro with argument as listPass a list through pgfkeyPredefined lists to loop through by @for or foreachtikz: help with this foreach loopTikz: cycling through a foreach functionHelp reproducing a tikzpicture image with foreachldots within Tikz foreach listExtract a sublist from a foreach list













1















My question is very simple. The following lines



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{
foreach y in {csname BLABLAxendcsname}{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


produces



1200,2800
5000,5500
1200,2800


instead of



1200
2800
5000
5500
1200
2800


foreach x iterates through {1,2,3} one by one. But
foreach y iterates through {1200,2800} as one argument.



What can I do?










share|improve this question









New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

    – Sebastiano
    5 hours ago
















1















My question is very simple. The following lines



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{
foreach y in {csname BLABLAxendcsname}{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


produces



1200,2800
5000,5500
1200,2800


instead of



1200
2800
5000
5500
1200
2800


foreach x iterates through {1,2,3} one by one. But
foreach y iterates through {1200,2800} as one argument.



What can I do?










share|improve this question









New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

    – Sebastiano
    5 hours ago














1












1








1








My question is very simple. The following lines



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{
foreach y in {csname BLABLAxendcsname}{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


produces



1200,2800
5000,5500
1200,2800


instead of



1200
2800
5000
5500
1200
2800


foreach x iterates through {1,2,3} one by one. But
foreach y iterates through {1200,2800} as one argument.



What can I do?










share|improve this question









New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












My question is very simple. The following lines



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{
foreach y in {csname BLABLAxendcsname}{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


produces



1200,2800
5000,5500
1200,2800


instead of



1200
2800
5000
5500
1200
2800


foreach x iterates through {1,2,3} one by one. But
foreach y iterates through {1200,2800} as one argument.



What can I do?







lists punctuation foreach






share|improve this question









New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 5 hours ago









Kurt

40.7k850164




40.7k850164






New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 5 hours ago









Bilal YilmazBilal Yilmaz

82




82




New contributor




Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Bilal Yilmaz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

    – Sebastiano
    5 hours ago














  • 1





    Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

    – Sebastiano
    5 hours ago








1




1





Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

– Sebastiano
5 hours ago





Welcome to the site TeX.SE. :-) I hope that you can appreciate it.

– Sebastiano
5 hours ago










1 Answer
1






active

oldest

votes


















3














Like this?



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{edefmylist{csname BLABLAxendcsname}
foreach y in mylist{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


enter image description here






share|improve this answer
























  • incredible! I searched for hours. Thank u very much!

    – Bilal Yilmaz
    5 hours ago








  • 1





    Sure! Thank you again :)

    – Bilal Yilmaz
    5 hours ago












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
});


}
});






Bilal Yilmaz is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483254%2fforeach-iterates-through-list-as-one-argument-help-please%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









3














Like this?



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{edefmylist{csname BLABLAxendcsname}
foreach y in mylist{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


enter image description here






share|improve this answer
























  • incredible! I searched for hours. Thank u very much!

    – Bilal Yilmaz
    5 hours ago








  • 1





    Sure! Thank you again :)

    – Bilal Yilmaz
    5 hours ago
















3














Like this?



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{edefmylist{csname BLABLAxendcsname}
foreach y in mylist{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


enter image description here






share|improve this answer
























  • incredible! I searched for hours. Thank u very much!

    – Bilal Yilmaz
    5 hours ago








  • 1





    Sure! Thank you again :)

    – Bilal Yilmaz
    5 hours ago














3












3








3







Like this?



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{edefmylist{csname BLABLAxendcsname}
foreach y in mylist{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


enter image description here






share|improve this answer













Like this?



documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{pgffor} %foreach

expandafterxdefcsname BLABLA1endcsname{1200,2800}
expandafterxdefcsname BLABLA2endcsname{5000,5500}
expandafterxdefcsname BLABLA3endcsname{1200,2800}



newcommand{somecommand}[1]{


foreach x in {#1}{edefmylist{csname BLABLAxendcsname}
foreach y in mylist{
y

}
}


}
begin{document}


somecommand{1,2,3}

end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 5 hours ago









marmotmarmot

114k5145276




114k5145276













  • incredible! I searched for hours. Thank u very much!

    – Bilal Yilmaz
    5 hours ago








  • 1





    Sure! Thank you again :)

    – Bilal Yilmaz
    5 hours ago



















  • incredible! I searched for hours. Thank u very much!

    – Bilal Yilmaz
    5 hours ago








  • 1





    Sure! Thank you again :)

    – Bilal Yilmaz
    5 hours ago

















incredible! I searched for hours. Thank u very much!

– Bilal Yilmaz
5 hours ago







incredible! I searched for hours. Thank u very much!

– Bilal Yilmaz
5 hours ago






1




1





Sure! Thank you again :)

– Bilal Yilmaz
5 hours ago





Sure! Thank you again :)

– Bilal Yilmaz
5 hours ago










Bilal Yilmaz is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Bilal Yilmaz is a new contributor. Be nice, and check out our Code of Conduct.













Bilal Yilmaz is a new contributor. Be nice, and check out our Code of Conduct.












Bilal Yilmaz is a new contributor. Be nice, and check out our Code of Conduct.
















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%2f483254%2fforeach-iterates-through-list-as-one-argument-help-please%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

Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...