# Creating a customizable n-ary operator?

I'd like to be able to create a customizable n-ary operator that behaves like \sum or \bigoplus but which takes an arbitrary symbol as an argument.

The closest that I have been able to come to achieving this is the following:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{relsize}

\begin{document}
\newcommand{\nop}[1]{\mathop{\mathlarger{\mathlarger{\mathlarger{\mathlarger{#1}}}}}}

$\nop{argument}_{i\in I} g_i$

\end{document}


Unfortunately the vertical spacing is, for lack of a better word, wrong and the space between the symbol and the limits is off as well. To see what's wrong with it try using \oplus as the argument and compare it to the output generated by \bigoplus_{i\in I} g_i. (If anyone knows how to fix the thickness that would be great too but it's not essential)

What I would like is something more along the lines of the code snippet in one of the answers on this page which is as follows:

\newcommand{\bignatural}{\mathop{\mathchoice
{\vcenter{\hbox{\LARGE$\natural$}}}
{\vcenter{\hbox{\large$\natural$}}}
{\vcenter{\hbox{\footnotesize$\natural$}}}
{\vcenter{\hbox{\scriptsize$\natural$}}}
}\displaylimits}


(or the similar code on this page or this other page) but, unfortunately, I'm not sure of how to go about doing this.

(note: I'm using MiKTeX with TeXstudio)

I'd really appreciate the input of someone who is better versed in LaTeX than I am.

-
Exact duplicate: tex.stackexchange.com/questions/23432/… –  Mechanical snail Dec 2 '12 at 1:33

Do you mean like this?

\documentclass{article}
\usepackage{amsmath}
\newcommand{\nop}[1]{\mathop{\mathchoice
{\vcenter{\hbox{\LARGE$#1$}}}
{\vcenter{\hbox{\large$#1$}}}
{\vcenter{\hbox{\footnotesize$#1$}}}
{\vcenter{\hbox{\scriptsize$#1$}}}
}\displaylimits}
\begin{document}
$\nop{G}_{\text{no operation}} G^{\nop{A}_\text{no operation}}$
\end{document}


-
Oh wow! I was really, really, close when I tried using the code snippet; I was just missing the math delimiters around #1. Thanks! I might do some messing around with the sizing to get it to match up with the other n-ary operators but that's fantastic :D –  JessC Jun 30 '12 at 5:51