I'd like to be able to write permutations in the correct way: Typesetting permutations with latex but I would like a command to do it automatically.
I have simply done it manually: (1\ 2\ 3)
etc. - no thank you. I can make a command for each one:
\newcommand{\threeperm}[3]{({#1}\ {#2}\ {#3})}
\newcommand{\fourperm}[4]{({#1}\ {#2}\ {#3}\ {#4})}
But (a) that doesn't seem like an efficient way around it considering I could easily be writing a permutation of up to 15 elements or so, and (b) I'd also like to be able to use it in subscript and have smaller spaces between the elements: and don't want to have to duplicate all of my commands like this:
\newcommand{\smallthreeperm}[3]{({#1}\, {#2}\, {#3}\, {#4})}
and so on.
Is there a way to create a macro to perform this task?
Thank you in advance for any help provided.