2

It seems like \vec makes \left( and \right) expand in an ugly fashion:

\begin{align*}
    \ g(\vec{f})
    \ g\!\left(\dot{f}\right)
    \ g\!\left(\dot{\vec{f}}\right)
    \ g\!\left(\vec{f}\right)
    \ g\!\left(f^2\right)
    \ g\!\left(\dot{f}^2\right)
    \ g\!\left(\vec{f}^2\right)
    \ g\!\left(\vec{f}\right)
    \ g\!\left(\frac{\partial f}{\partial t}\right)
    \ g\!\left(\frac{\partial \vec{f}}{\partial t}\right)
\end{align*}

What happens is that there is too much whitespace underneath the letter, which is rather... jarring.

Interestingly, while \dot, etc. do the same thing, superscripts don't.

How can I prevent this from happening given that I need to use \left( and \right)?

screenshot

user541686
  • 9,547
  • Just use g(\vec{f}\,) Fine spacing is often necessary when coping with clashing symbols. – egreg Feb 28 '16 at 22:32

1 Answers1

4

You start from the wrong assumption that the parentheses should vertically cover the whole symbol. It's not so: some overshooting doesn't hinder reading and understanding the meaning.

When \vec is involved (which I consider an inherently flawed notation, but that's not under discussion), some fine adjustments are necessary if a prime or a parenthesis follows:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
g(\vec{f}\,)
\quad
g(\dot{\vec{f}}\,)
\quad
g\bigl(\dot{\vec{f}}\,\,\bigr)
\quad
g\biggl(\frac{\partial\vec{f}}{\partial x}\,\biggr)
\quad
g\biggl(\frac{\partial\dot{\vec{f}}}{\partial x}\,\biggr)
\]
\end{document}

Don't use \left and \right in these cases: as you clearly saw, they choose the wrong size for the delimiters.

enter image description here

Here's a way with \left and \right; not that I can recommend it.

\documentclass{article}
\usepackage{amsmath,mleftright}

\mleftright % fix the bad spacing of \left and \right

\begin{document}
The following is mostly a joke
\[
\left(
  \vphantom{\frac{\partial f}{\partial x}}
  \frac{\smash[t]{\partial\vec{f}}}{\partial x}\,
\right)
\vphantom{\frac{\partial\vec{f}}{\partial x}}
\]

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thanks but this isn't an answer to my question though. I specifically said given that I need to use \left and \right. The whole point of my question is to let the system auto-size and prevent \vec from affecting the sizing, just as how a superscript doesn't affect the auto-sizing. I also never made that assumption... I'm perfectly fine with a \vec that doesn't cause the parentheses to cover the whole symbol (in fact, that's basically what I'm asking for). – user541686 Feb 28 '16 at 22:50
  • @Mehrdad What I wanted to say is that you can't get good results with \left and \right. You could \smash the letter with \vec, but this will just shift the problem to line spacing. – egreg Feb 28 '16 at 22:51
  • Oh, interesting... is there no way to e.g. make the \vec "float" in some sense, so that it's there but doesn't take up space? Edit: just saw your edit, I see. – user541686 Feb 28 '16 at 22:53
  • Funny enough, \smash seems to do exactly what I want at least for non-inline math when line spacing isn't an issue. I imagine some combination with \phantom might do the job in some other cases. You should put that in your answer! – user541686 Feb 28 '16 at 22:58
  • @egreg on a related note: do you have any advise on the placement of the arrow? To me the vector on f is too much to the right (have that problem in a manuscript I'm editing, I hacked something ugly and wonders if there us a better solution) – daleif Feb 28 '16 at 23:02
  • @daleif: Wow, I hadn't even noticed until you pointed it out now... and now I can't un-see it -.- thanks :P – user541686 Feb 28 '16 at 23:11
  • @daleif Probably something like {\mspace{1.5mu}\vec{\mspace{-1.5mu}f}} – egreg Feb 28 '16 at 23:11
  • @egreg: By the way, why do people hate \left and \right so much? I feel like every time I've asked a question about how to do something with those two commands, the first answer I've received has been to not use them. Do you know why...? – user541686 Feb 28 '16 at 23:12
  • @egreg that was sort of what I'm doing. Mspace is that just mkern in cosplay? – daleif Feb 28 '16 at 23:13
  • @mehrdad mostly because they so often get a little or a lot too big. I usually go by this rule: it should be clear for the reader what is being fenced in. But the fences should not become the focal point – daleif Feb 28 '16 at 23:15
  • @daleif Yes, \mspace is defined by amsmath in analogy with \hspace; it is \mskip in disguise. – egreg Feb 28 '16 at 23:18
  • @egreg interesting, never seen it before – daleif Feb 28 '16 at 23:19
  • 1
    @Mehrdad - "Why do people hate \left and \right so much?" Check out the postings Is it ever bad to use \left and \right? and “(” or “\left(” parentheses? for information on why using \left and \right indiscriminately can lead to undesirable typographic outcomes. – Mico Feb 28 '16 at 23:34