Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having trouble with the appearance of parentheses representing function arguments. They appear to far away from the function name.

For example the code

\left(1-f_{p}\left(l+1\right)\right)\overline{w}\left(l\right)f_{p}\left(l\right)\overline{N}\left(l\right)\hat{H}_{s}\left(l\right)

produces

Expression, as rendered

in which the arguments seem to float midway between successive function names; but I'd prefer (and expect) something more like

Expression, adjusted for desired appearance

which does a better job of attaching the arguments to the function names.

Is there something I can do to achieve the result I'm looking for?


FWIW, I've settled (for now) on

\bigl(1\!-\! f_{p}(l\!+\!1)\bigr)\;\overline{w}(l)\; f_{p}(l)\;\,\overline{\! N}(l)\;\hat{H}_{s}(l)

which produces

Expression, after improvements

share|improve this question
    
I'm using the tufte-book document class with LyX, but I see pretty much the same result regardless of what tools I experiment with. –  raxacoricofallapatorius Feb 21 '12 at 0:08
    
One should never use negative spacing like \! for kerning aroung binary operations or relations; see this answer of mine for details. –  Hendrik Vogt Jun 15 '12 at 17:56
    
@HendrikVogt: Was uncomfortable with that, but it seems the only way to fix the problem that Todd identified. What approach would you recommend? –  raxacoricofallapatorius Jun 15 '12 at 18:34
1  
Use something like \mkern1mu{+}\mkern1mu (and adjust the 1 to your needs). –  Hendrik Vogt Jun 15 '12 at 18:37
add comment

5 Answers

up vote 12 down vote accepted

Mostly the extra space comes from \left \right which you don't really need here, you could also declare your compound operators are operators

\documentclass{article}

\begin{document}

\[
\left(1-f_{p}\left(l+1\right)\right)\overline{w}\left(l\right)f_{p}\left(l\right)\overline{N}\left(l\right)\hat{H}_{s}\left(l\right)
\]


\[
(1-f_{p}(l+1))\overline{w}(l)f_{p}(l)\overline{N}(l)\hat{H}_{s}(l)
\]


\[
(1-\mathop{f_{p}}(l+1))\mathop{\overline{w}}(l)\mathop{f_{p}}(l)\mathop{\overline{N}}(l)\mathop{\hat{H}_{s}}(l)
\]


\end{document}

enter image description here

share|improve this answer
    
Could you say a bit more about why they \left( and \right) aren't really needed here? According to the "book" it should be fine to use them. –  Marc van Dongen Feb 21 '12 at 1:11
5  
@MarcvanDongen, \left\right has two functions, they allow the operators to stretch (but in most cases no stretching was happening in this example) but the second function is that it makes the subterm a \mathinner atom and that gets additional white space in many contexts. Presumably Knuth preferred this in some contexts, but the OP was specifically asking not to get that space and so not generating mathinner atoms is the answer –  David Carlisle Feb 21 '12 at 1:27
1  
Thanks. I've never seen this expained in any documentation (but I may have missed it). I did notice Werner's answer touches it. –  Marc van Dongen Feb 21 '12 at 1:34
add comment

The use of \left and \right extensible delimiters introduces additional horizontal spaces. I would suggest against using them in cases where it is obviously not necessary (like in your example). Rather introduce some distinction between factors in the expressions, if you which to distinguish functions and arguments, using \,:

enter image description here

\documentclass{article}
\begin{document}
The old\ldots
\[
  \left(1-f_{p}\left(l+1\right)\right)\overline{w}\left(l\right)f_{p}\left(l\right)\overline{N}\left(l\right)\hat{H}_{s}\left(l\right)
\]

The new\ldots
\[
  (1-f_{p}(l+1))\overline{w}(l)\,f_{p}(l)\,\overline{N}(l)\,\hat{H}_{s}(l)
\]
\end{document}​
share|improve this answer
add comment

I think you have two problems, actually. The first is that, as you noticed, the parentheses are too far from their associated functions; this is because you are overusing \left and \right. The second is that they are also too close to the following functions; this can be cured by some explicit spacing (similar to what you might want to use in, say, $\int f(x) \, dx$).

\documentclass{tufte-book}
\begin{document}
 $\bigl(1-f_{p}(l+1)\bigr)\, \overline{w}(l)\, f_{p}(l)\, \overline{N}(l)\, \hat{H}_{s}(l)$
\end{document}

Original versus corrected

I removed all of your \left...\right pairs and replaced the first one with \bigl...\bigr. This produces slightly (but explicitly) larger parentheses around the contained expression, which creates a subtle visual effect against the nested set.

By the way, a complete compilable document is preferred in questions like these. As it turns out, my guess at your preamble was correct, but it might not have been.

share|improve this answer
add comment

This is a prime example of why \left and \right should not be abused. In the picture, the first line comes from your input, the second from

$(1-f_{p}(l+1))\overline{w}(l)f_{p}(l)\overline{N}(l)\hat{H}_{s}(l)$

enter image description here

share|improve this answer
add comment

Fixing the kerning

In this case I would use \! to tighten the kerning of the plus and minus, because the expression (1-f_p(l+1)) is but one of five factors in the larger expression. (Alternatively, \mathord{+} and \mathord{-} could be used, but these kern a bit too tightly (unless \, is used between the other factors). I would also use \,\, instead of \, here as it provides a slight in increase in spacing that I think improves readability.

\big(1\!-\!f_p(l\!+\!1)\big)\,\,\overline{w}(l)\,\,f_p(l)\,\,\overline{N}(l)\,\,\hat{H}_s(l)

Here are a few variants. #1 is way too loose (as originally pointed out), #2 is way too tight, and the others are a matter of taste. Personally, #5, #7, and #9 are my favorites—with probably #7 being my most favorite.

versions

If you want to get really picky about kerning, notice that the italic math l in #6–#11 is kerned too closely to the +. Fixing this for #6–8, you could use f_p(l\kern.1em\!+\!1) and f_p(l\kern.09em\mathord{+}1) for #9–11 (neither shown above). It’s actually also a wee bit tight in #3–5, but less noticeable there.


Fixing the overline

You didn’t ask about the overline, but I can't help pointing out that the \overline{N} looks odd in the expression because \overline was not properly designed for tall italic letters.

If you would like the overlined N to look nice, you could replace all occurrences of $\overline{N}$ with \,$\overline{\!N}$. Or, a simpler solution could be to define a new command \overlinetall:

\newcommand{\overlinetall}[1]{\,\overline{\!#1}}

overline

share|improve this answer
1  
Great—now I'm going to be up all night! –  raxacoricofallapatorius Feb 21 '12 at 4:44
3  
It should be \bigl( and \bigr), to account for the roles of the parentheses. –  egreg Feb 21 '12 at 7:36
    
Oops, thank you. –  Todd Lehman Feb 21 '12 at 8:08
    
I totally agree with you on the \overline! (See also this answer of mine for automatic kerning of \overline.) But note that one shouldn't use negative spacing like \! for kerning around binary operations or relations; see this answer for details. Better use something like \mkern1mu{+}\mkern1mu. (Only in AMS environments like align, the negative spacing can't do any harm.) –  Hendrik Vogt Jun 23 '12 at 11:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.