Math & Sciencetext above and below like summation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
stargoo
Posts: 3
Joined: Sun Jan 11, 2009 4:23 am

text above and below like summation

Post by stargoo »

I want to put text above and below a symbol (\cup) just like I would for a summation. caret and underscore doesn't work. Anyone know a way to do this?

Thanks,
Scott

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

Re: text above and below like summation

Post by drowsy »

Use \bigcup. Unless it is a $$...$$$ formula you also have to use \displaystyle{...}.
stargoo
Posts: 3
Joined: Sun Jan 11, 2009 4:23 am

Re: text above and below like summation

Post by stargoo »

Worked perfect. Thank you!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

text above and below like summation

Post by gmedina »

Hi,
stargoo wrote:I want to put text above and below a symbol (\cup) just like I would for a summation. caret and underscore doesn't work. Anyone know a way to do this?...
As drowsy suggested, using \bigcup allows the placement of subscripts and superscripts; however, using the starred form of the \DeclareMathOperator command (provided by the amsmath package), you can get subscripts and superscripts working with a command that emulates \cup, as the following example suggests:

Code: Select all

\documentclass{report}
\usepackage{amsmath}

\DeclareMathOperator*{\mycup}{\cup}

\begin{document}

text text $\mycup_{i=1}^{n-2}$ text text text

text text $\mycup\limits_{i=1}^{n-2}$ text text text

\[ \mycup_{i=1}^{n-2} \]

\end{document}
Please refer to the amsmath documentation for details (section 5 Operator Names, pages 17 and 18).
drowsy wrote:...Unless it is a $$...$$$ formula you also have to use \displaystyle{...}.
The $$...$$ construct is obsolete and shouldn't be used anymore (see reasons in l2tabu); in its stead it is preferable to use \[...\].
1,1,2,3,5,8,13,21,34,55,89,144,233,...
stargoo
Posts: 3
Joined: Sun Jan 11, 2009 4:23 am

Re: text above and below like summation

Post by stargoo »

I like the DeclareMathOperator. Very nice. I hadn't seen l2tabu. I'd say that it's an essential read for any newbie or advanced user. I've been using doublespace and the old version of caption for the last year (still rather newbie-ish in all this) and never realized they were obsolete.
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

text above and below like summation

Post by drowsy »

The $$...$$ construct is obsolete and shouldn't be used anymore
I know... sigh... I just wanted to say it fast.
Kind of boring to type begin{equation} and \[\] looks ugly and confusing.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

text above and below like summation

Post by gmedina »

drowsy wrote:
The $$...$$ construct is obsolete and shouldn't be used anymore
I know... sigh... I just wanted to say it fast.
Kind of boring to type begin{equation} and \[\] looks ugly and confusing.
Precision is preferable to rapidness. And, what could be more confusing than $$...$$?. At least \[...\] gives you the idea of opening and closing an environment.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply