How would I do {text}_{i=1}^{i=n} with the written exactly above and below the text?
Hope you can help!
How would I do {text}_{i=1}^{i=n} with the written exactly above and below the text?
Hope you can help!
I assume you'll want the subscript and superscript material to be in display-style math mode and to use a smaller font size than what's used for the "text" string. Sort of like \sum_{i=0}^{\infty}, except for the use of the string "text" instead of the large summation symbol, right?
If these assumptions are correct, you could use the \DeclareMathOperator* directive of the amsmath package to achieve your objective.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\sometext}{text} % "\text" is already taken...
\begin{document}
\[
\sometext_{i=1}^{i=n} % not "{\sometext}"
\]
\end{document}
\[ \overset{i=n}{\underset{i=1}{text}} \] could also be an option. No info about the context for the expression, it's difficult to decide the best approach. +1, by the way.
– Gonzalo Medina
Jul 21 '15 at 18:22
Here are two ways:
\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\begin{document}
\[
\setstackgap{S}{2pt}
\stackunder{\stackon{\text{text}}{\scriptstyle i=n}}{\scriptstyle i=1}
\quad
\underset{i=1}{\overset{i=n}{\text{text}}}
\]
\end{document}

The gap between the text and the over/under-set is defined with \setstackgap{S}{2pt} for the stackengine approach on the left.
Either of these approaches will work in \displaystyle (shown) or in \textstyle. Note, however, that in \textstyle, the line spacing will be affected.
In addition to the other suggestions you could use: \mathop together with \operatorname from the amsmath package:
\documentclass{article}
\usepackage{amsmath}
\newcommand\mymathop[1]{\mathop{\operatorname{#1}}}
\begin{document}
\[
\mymathop{text}_{i=1}^{i=n}
\]
This is in a paragraph: $\mymathop{text}_{i=1}^{i=n}$ or $\displaystyle\mymathop{text}_{i=1}^{i=n}$.
\end{document}


\documentclass{article}
\usepackage{stackrel}
\begin{document}
Some $\stackrel[i=1]{i=n}{\mathrm{text}}$ in line.
\end{document}
\usepackage{amsmath}in the document\[ \overset{i=n}{\underset{i=1}{text}} \]– Gonzalo Medina Jul 21 '15 at 18:20