Math & ScienceI hate radicals in LaTeX !

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

I hate radicals in LaTeX !

Post by Cham »

I'm having troubles with an index and an exponent under a radical, and I don't know anymore what to do ! :x

Here's a MWE to show the problem :

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{tensor}

\begin{document}
	\begin{equation}
		I =
		\begin{cases}
			\, \displaystyle{\frac{1}{2} \; A \smash{\left( \tensor{t}{_0} + \alpha - \frac{\beta}{\displaystyle{\sqrt{2 \alpha \, \smash{\tensor{t}{_0} + t_0^2}}}} \, \right)}}, &\text{if $k = - 1$.} \\[18pt]
			\, \displaystyle{\frac{2}{3} \; A \, \tensor{t}{_0}}, &\text{if $k = 0$.} \\[18pt]
			\, \displaystyle{\frac{1}{2} \; A \smash{\left( \tensor{t}{_0} - \alpha + \frac{\beta}{\displaystyle{\sqrt{2 \alpha \, \tensor{t}{_0} - t_0^2}}} \, \right)}}, &\text{if $k = + 1$.}
		\end{cases}
	\end{equation}
\end{document}
Here's a preview of what it does :
radical.jpg
radical.jpg (25.48 KiB) Viewed 4267 times
Now, the first radical has a proper size, since I smashed the "0" index, but then the "2" exponent is too close to the horizontal bar. The second radical is too big and there is too much space inside, while the "2" exponent is right.

Take note that smashing each "0" index separately doesn't change anything.

How can I lower the "2" exponent in the first line ?

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

Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

I hate radicals in LaTeX !

Post by Cham »

Ah ! Removing the \displaystyle{} around the radical and adding \vphantom{1^1} inside seems to fix the problem.

Is there a better way in doing this ?
Post Reply