1

Whenever a new command is declared, each argument has to be in brackets {}, so that a new macro with several mandatory arguments looks like this:

\myMacro{1stArg}{2ndArg}{3rdArg}{4thArg}

Is there any way to get a macro that looks like this?

\myMacro{1stArg, 2ndArg, 3rdArg, 4thArg}
  • 3
    We have a number of (near) duplicate questions on the site. Here are two of the more comprehensively answered ones: What is the best way to scan over a list of somethings? and How to iterate over a comma separated list? – Alan Munn Nov 20 '16 at 19:25
  • You can with   xparse. However, I would not recommend using commas as separators, they're used in too many contexts. Maybe semi-colons? Do you have something precose in mind? – Bernard Nov 20 '16 at 19:26
  • Thank you for fast answering. Semicolon is ok, anyway! Thank you: the argument is centered in the answer you addressed. – Paolo Polesana Nov 20 '16 at 19:28
  • There are ways for getting that. Before elaborating extensively, information is needed about how to treat a) spaces surrounding commata and/or arguments b) empty/blank arguments (i.e. consecutive (space separated) commata) c) arguments that themselves are to contain commata or surrounding spaces--shall there be a possibility of wrapping arguments into braces which get automatically removed while preserving spaces and commata belonging to an argument itself d) Comma(ta) at the end of the argument-list. – Ulrich Diez Nov 20 '16 at 19:33

0 Answers0