Is it possible to create a simple, robust command with a variable number of arguments for the following specific use-case ?



What \bigmap{F}{a_{1}}{a_{2}}{a_{3}}{b_{1}}{b_{2}}{b_{3}} does is, it creates a map

enter image description here

But I would like this command dto be flexibel, so that I may add more or less a_i and/or b_i, like

enter image description here

(Nota bene: For that, of course, it one more argument would be necessary that specifies in the sequence of arguments #1, #2, ... #N, which one belong to the left parenthesis of the function and which ones to the right.
The existing answers to allow commands with variable arguments are much too complex for me to understang as they refer to much more complicated use cases. If possible, I would like less lines of code than those answers to achieve this goal.
The answer from LaTeX newcommand with a variable number of arguments is very close to what I want, but unfortunately it falls short of a way to tell the command, like I mentioned in the first paragraph here, which of the arguments of the list should go where in the function.
Also note that solution like LuaTex would only be employed, if nothing else works.)


  • 1
    Erh, that macro only needs 3 args if done slightly different. {F} {a\\b\\c} {d\\e} I'll leave the details to you
    – daleif
    Sep 25, 2016 at 18:49

1 Answer 1


Does the following solution meet your expectations for simplicity and flexibility? :-)

Instead of thinking of each row of each of the two column vectors being a separate argument, you may want to think of each entire vector as being one of the arguments of the macro \bigmap. That way, the macro \bigmap may be defined as having exactly 3 arguments.

enter image description here

\usepackage{amsmath} % for 'pmatrix' environment


  • It was simpler to delete my answer than to produce also a screenshot. And you are in need of reputation points anyway ;-) I just moved my introductory sentence to your post; feel free to delete it.
    – gernot
    Sep 25, 2016 at 18:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .