Math & ScienceSize Problem with Root Sign

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

Size Problem with Root Sign

Post by Cham »

I'm having a size problem with the square root. See the following compilable code :

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern} % interaction between these two packages ?
\usepackage{amsmath} %

\begin{document}
	\begin{equation}
		\sqrt{\varphi^2 - \vartheta^2} = \sqrt{E^2 - B^2}.
	\end{equation}
\end{document}
The first square-root sign isn't right (too big). The second square-root sign is nice.

If I comment out the lmodern package, the first square-root sign turns fine. If I comment-out BOTH the lmodern and the amsmath packages, the first square-root sign turns ugly (the second square-root doesn't change). So I guess the amsmath package is what gives a nice output, while the lmodern package turns-off that feature.

How can I tell LaTeX to keep the nice amsmath output, while still using the lmodern package ?

Changing the packages loading order doesn't help here.

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Size Problem with Root Sign

Post by Stefan Kottwitz »

Hi Cham,

I guess the descender of the \varphi is the cause. You could smash it to get a smaller square root, as a workaround:

Code: Select all

\sqrt{\smash{\varphi}^2 - \vartheta^2} = \sqrt{E^2 - B^2
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Size Problem with Root Sign

Post by localghost »

The "culprit" is definitely the lmodern font package. The design of the Greek phi provides a slightly different descender that seems to cause the automatic scaling of the root sign.

You can hide the sizes of the box (depth here) that contains the phi by the \smash command.

Code: Select all

\documentclass[12pt,letterpaper,french]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  aacute={á},
  ccedilla={ç},
  Euro={€}
}
\usepackage{babel}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{lmodern}

\begin{document}
  \begin{equation}
    \sqrt{\smash{\varphi}^2-\vartheta^2}=\sqrt{E^2-B^2}.
  \end{equation}
\end{document}
By the way, good example.


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

Re: Size Problem with Root Sign

Post by Cham »

Aah ! Thanks guys, now it's perfectly clear. :)

I learn a new thing each day ! :geek:

Case solved !
Post Reply