8

If I'm interested in using an arbitrary symbol or character instead of the default sum-class symbols (such as \int, \coprod, etc), solely with the interest of preserving subscripts and superscripts above and below the symbol, how should I proceed?

jub0bs
  • 58,916

1 Answers1

11

Try \DeclareMathOperator*{\foo}{...}. You'll need to load the amsmath package. This makes \foo have "limit-style" subscripts and superscripts.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator*{\foo}{\maltese}

\begin{document}
\[
\foo_{i=3}^{6}(f^2(i))
\]
\end{document}

enter image description here

If you want the symbol to be larger, then just writing \Large\maltese won't work. Instead, you could use:

\DeclareMathOperator*{\foo}{\text{\Large $\maltese$}}

enter image description here

  • there's already a \bigoplus that comes in the requisite two sizes, one for in-text, and one for display. for large operators that aren't yet "available", the two-size convention should be observed, so either two different operaters should be defined, or a rather more complicated formulation using \mathchoice (in which sizes appropriate for use in sub/superscripts can also be provided). – barbara beeton May 27 '13 at 14:34
  • Heh, that's true. I should really have chosen one of the gazillion other symbols available! – John Wickerson May 27 '13 at 17:19
  • 1
    if you want to revise your answer, why don't you try \maltese (from amsfonts). i'm pretty sure that comes in only one size. i was going to suggest \box<something>, but noticed (in the comprehensive symbols list) that \bigbox<something> has actually been concocted for nearly all <something>s. – barbara beeton May 27 '13 at 17:27
  • 1
    +1 Note also that for a one-off use one has the low-level \( \mathop{\wr}\limits_{i=1}^n \). – Andrew Swann May 28 '13 at 06:20
  • 1
    @barbarabeeton I've revised my answer as per your suggestion. Thanks :-). Btw, what's the "proper" way to do this? I mean, how is \Sigma scaled to the right size and vertical position to make a summation symbol, for instance? – John Wickerson May 28 '13 at 06:50
  • @ConcernedUndergraduate You're welcome :-). If the answer has now solved your problem, please consider clicking the "tick mark" to mark it as accepted. And if not, do let us know. – John Wickerson May 28 '13 at 12:05
  • @JohnWickerson -- \Sigma (and other large operator symbols) are present twice in what's called the "extension font", and "chained" from smaller to larger. the "correct" one is chosen and positioned (centered vertically on the math axis) by the tex engine depending on the context: text, display, first-order script, second-order script (the last two are reduced in size from the text-size form; the first two are set at "true" size, modulo the actual size of the surrounding text, i.e., reduced for footnotes, enlarged for some titles). this would make a good question itself -- ask it! – barbara beeton May 28 '13 at 12:16
  • @barbarabeeton There's a question here on which you might have an opinion...:-). – John Wickerson May 28 '13 at 12:38