Math & ScienceDifference between \[ \] and $ $

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mdrapk
Posts: 13
Joined: Mon Mar 11, 2013 6:31 pm

Difference between \[ \] and $ $

Post by mdrapk »

I fear I'm about to lose my head for this: what is the difference between the two constructs above?

I use $ A = \bigcup_{j=1}^n$ and I get the limits on the side of the U symbol. If I use \[ A = \bigcup{j=1}^n \] I get limits above and below (as I wanted).

Is \[ \] invoking some other environment? I'm not even a novice - that would take another ten years.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Difference between \[ \] and $ $

Post by localghost »

The TeX syntax $ … $ is for in-line math mode. It's LaTeX equivalent is \( … \). In in-line math mode limits to operators (integrals, sums, …) are typeset beside them in order not to disturb the line spacing. You can force limits above and below the operators by either using \limits directly after an operator command or \displaystyle at the beginning of a math expression.

On the other hand \[ … \] starts a displayed math environment (for unnumbered equations) where limits are typeset below and above operators by default. To typeset limits beside operators here you can use \nolimits as counterpart to the above mentioned \limits.


Further reading:

Thorsten
mdrapk
Posts: 13
Joined: Mon Mar 11, 2013 6:31 pm

Re: Difference between \[ \] and $ $

Post by mdrapk »

Thank you. That was very clear and helpful. I also appreciate the additional reference. I have much to learn.
Tony
Post Reply