5

Very simple problem, but very confusing. When I type

\left( \frac{\partial f}{\partial x }  \right)^2

I get smaller parentheses but when I type the same thing but with y instead of x, i.e.

\left( \frac{\partial f}{\partial y }  \right)^2

I get larger ones... what's up with that? Is it a known problem or do I have to supply more information?

UPDATE (after reading some comments):

This difference isn't present if the expression is written by itself, but only if it's in the denominator, i.e. when I write

\frac{...something...} { \left( \frac{\partial f}{\partial x }  \right)^2 + \left( \frac{\partial f}{\partial y}  \right)^2}

I get parentheses of different size!

karlkoeller
  • 124,410
lel
  • 151
  • 5
    Simply y adds more vertical space and the parenthesis in bigger. Are you looking for a solution to make them the same size? – karlkoeller Aug 14 '13 at 08:27
  • Thanks, that makes sense! A solution would be nice, you can post it as an answer if you want :) – lel Aug 14 '13 at 08:30
  • 2
    To manually control parentheses size, you can use \big( and \big), instead of \left( and \right. See http://tex.stackexchange.com/a/38870/18228 for more size options. – Herr K. Aug 14 '13 at 08:41
  • Excellent, that did the trick! – lel Aug 14 '13 at 08:47
  • 1
    The method linked by @KevinC is the right one in these cases (\biggl and \biggr seem to be the more appropriate in your case). As an alternative you can put \vphantom{y} next to the x in your first equation. – karlkoeller Aug 14 '13 at 08:51
  • @karlkoeller: I thought the problem may be more complicated than that? \left and \right delimiters are supposed to be symmetric around math axis. However df/dx and df/dy have similar height and relatively close depth (6.9pt vs 8.8pt in display mode), so there shouldn't be any notable difference in the delimiter size. (Correct me if I am wrong) – Francis Aug 14 '13 at 09:40
  • @Francis I can not see any difference, but probably it looks different in Lyx. – karlkoeller Aug 14 '13 at 09:43
  • @karlkoeller: Indeed, the vertical difference is less than 2pt. But I don't use LyX so I wouldn't know. :P – Francis Aug 14 '13 at 09:46
  • @karlkoeller it must be a Lyx thing - I just tested the MWE in MikTeX 2.9, screengrabbed the pdf zoomed well in and overlaid in the gimp. The only difference bweteen the 2 is in the denominator, x and y are slightly different widths, but the parentheses are exactly the same height (to 1 part in about 250). – Chris H Aug 14 '13 at 09:49
  • Just to point out, the differences I was getting were obvious and noticeable right away with the naked eye. – lel Aug 14 '13 at 09:55
  • @SchlomoSteinbergerstein You should try showing the LaTeX file produced by LyX, as the problem seems unreproducible with standard settings. – egreg Aug 14 '13 at 10:02
  • I tried to do that and I found out that it happens only when the expression is in the denominator! I'll update my question accordingly. – lel Aug 14 '13 at 10:13
  • 1
    More than interested, excellent! I really hope it grows into a high-quality community similar to mathoverflow! – lel Aug 27 '14 at 14:07

1 Answers1

4

Here is an great old post that provide thorough explanation on how \left and \right work:

Incorrect delimiter size in math mode

Now back to your question, as karlkoeller explained, letter y adds more vertical space so the parenthesis become bigger. It can be observed as the followingenter image description here

There are basically three ways to solve the problem, we can choose among redefining \left and \right (which is strongly recommended) as the post above suggested, increase the size of df/dx, and decrease the size of df/dy. The size changing can be accomplished by using \rule or \raisebox:

\documentclass{article}
\usepackage{amsmath}

\newlength{\dyfoo}
\newlength{\hyfoo}
\newlength{\dxfoo}
\newlength{\hxfoo}
\settodepth{\dyfoo}{\(\displaystyle\frac{\partial f}{\partial y}\)}
\settoheight{\hyfoo}{\(\displaystyle\frac{\partial f}{\partial y}\)}
\settodepth{\dxfoo}{\(\displaystyle\frac{\partial f}{\partial x}\)}
\settoheight{\hxfoo}{\(\displaystyle\frac{\partial f}{\partial x}\)}

\begin{document}
\[
\left(\frac{\partial f}{\partial x}\right)
\left(\frac{\partial f}{\partial \vphantom{y}x}\right)
\left(\frac{\partial f}{\partial y}\right)
\left(\raisebox{0pt}[\hyfoo][\dyfoo]{\(\displaystyle\frac{\partial f}{\partial x}\)}\right)
\left(\raisebox{0pt}[\hxfoo][\dxfoo]{\(\displaystyle\frac{\partial f}{\partial y}\)}\right)
\]
\end{document}

Compare the result:

enter image description here

Remark:

\left and \right delimiters are supposed to be symmetric around math axis. Hence the vertical difference in both delimiter are no larger than 2pt. So there shouldn't be any necessity to make the adjustment.

Francis
  • 6,183