[Tex/LaTex] variables within a new command

macros

The integers modulo n, given by

\mathbb{Z}/n\mathbb{Z}

is cumbersome to write. Accordingly, I would like to set up a new command that allows me to specify an input 'n'. Something like

\newcommand{\Z[character]}{\mathbb{Z}/[character]\mathbb{Z}}

But the above code is not right. Does anyone have any idea how this might be done?

Best Answer

\newcommand\Z[1]{\mathbb{Z}/#1\mathbb{Z}}
Related Question