In a mathematical text which I write, I want to denote a certain number by $S(x;q,a)$. The number, as you may have guessed, depends on three parameters $x, q, a$. I would like to give this expression a shortcut, because maybe I will change my mind in the end and rather denote the number as $S(x;a,q)$ or something the like. Then I will not have to go all over the text and look for instances of this expression.
So I defined a new command in the preamble in the following way:
\newcommand{\Sc}[3]{S(#1; #2, #3)}
This works, i. e. if I now type \Sc{x}{q}{a}, then the desired output is displayed.
Most times when I use this command, the three parameters I give to the command will be x, q, and a in this order. Only sometimes other parameters will occur in the use of \Sc. So a shortercut seems possible.
Ideally, I would like to only type \Sc as a shortcut for \Sc{x}{q}{a}. But the use \Sc{a}{b}{c} has to remain valid so that I can pass other parameters to \Sc if needed.
In order to achieve this, I tried
\newcommand{\Sc}[3][x][q][a]{S(#1; #2, #3)}
But apparently, there is at most one optional argument permitted in \newcommand, as I learned. (If this is wrong, please correct me.)
Is there a way to have all three parameters of my new command optional and such that x, q, and a are the defaul values?
Edit: Apparently, I didn't make the point clear enough. What I would like to typeset are two things. One is $S(x;q,a)$ with these three parameters x, q, and a. The other is $S(_; _, _)$ where I do not know yet what the three parameters are. Both should be possible with the same command \Sc.
For displaying $S(x;q,a)$, I would like to type only \Sc. So, in a sense, the parameters x (as the first parameter), q (second), and a (third) should be default. For displaying $S(_; _, _)$ with a parameter-triple (_, _, _) different from (x,q,a), I would like to use the command with all three parameters. For example I would type $\Sc{x}{q}{b}$ in order to produce $S(x;q,b)$.




\Sc xqadoes the same thing as\Sc{x}{q}{a}, and if typing out those arguments is easy enough, maybe you don't need the default values. – Misha Lavrov Sep 03 '21 at 20:51