Math & ScienceExactly under max/min

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Roronoa Zoro
Posts: 1
Joined: Wed Mar 02, 2011 9:14 am

Exactly under max/min

Post by Roronoa Zoro »

When I write my code

Code: Select all

\max_{0 \leq q \leq n-1}
the '0<= q <= n-1' does not show underneath the max, instead next to it but a little bit below. I want '0<= q <= n-1' exactly under the max.

Thank you

Zoro

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Exactly under max/min

Post by Frits »

This only happens when you use an inline math environment. I agree that doesn't look okay, but if LaTeX would put the argument underneath the \max, your linespacing would need to be larger which doesn't look nice overall.
My advice would be to rewrite your sentence to announce an equation. Something like:

Code: Select all

The function we want to maximize yields:
\begin{equation}
\max_{0 \leq q \leq n-1}
\end{equation}
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

Exactly under max/min

Post by shadgrind »

If you're OK with the possibility of the inline math part overlapping text on the line below, then there's a way of doing this so that the line spacing doesn't change:

Code: Select all

We will now show that
$\smash{\displaystyle\max_{0 \leq q \leq n-1}} f(q) \le n$,
blah blah blah blah blah blah blah blah blah blah blah blah.
That will look like this:
inline.png
inline.png (5.12 KiB) Viewed 128236 times
Notice that if I had one more "blah" then there would be some overlap. To avoid that you'd have to remove the \smash command, but that would cause extra space for the line below, which may look bad compared to the spacing between other lines:
inline2.png
inline2.png (5.76 KiB) Viewed 128236 times
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
Post Reply