ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: math: too big space between function and argument
Date: Tue, 24 May 2011 09:56:34 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.02.1105240948260.3669@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <1306235645.4255.17.camel@mattotaupa>

On Tue, 24 May 2011, Paul Menzel wrote:

> Dear ConTeXt folks,
>
>
> to markup the probability measure and the parenthesis around the
> argument, I defined the following command.
>
> 	\define[1]\P{{\mathbf P}\left( #1 \right)}
>
> Unfortunately the space between the P and the left ( is a little big in
> my opinion. Is that correct or should/can I fix that somehow?

Getting these spaces is tricky; especially if you consider spaces before 
and after the definition. Choose your pick:

\starttext
  \startformula
   A{\mathbf P}\left( ABC \right)B \quad
   A\mathop{\kern\zeropoint\mathbf P}\left( ABC \right)B \quad
   A{\mathbf P}\mathopen{}\left( ABC \right)\mathclose{}B \quad
   A\mathop{\kern\zeropoint\mathbf P}\mathopen{}\left( ABC \right)\mathclose{}B \quad
  \stopformula
\stoptext

Some information from the mathsets module (which does not work with MkIV). 
The entry is the latex bug database is not viewable now.

%D The \type{\left} and \type{\right} generate a math atom of type inner,
%D while for math sets, we want a math open atom. To see the difference,
%D consider
%D
%D \startbuffer
%D \startformula
%D  2\left(\frac {3}{4} \right) \qquad \hbox{ vs } \qquad
%D  2\biggl( \frac {3}{4} \biggr)
%D \stopformula
%D
%D and
%D
%D \startformula
%D  \Pr\left(\frac {3}{4} \right) \qquad \hbox{ vs } \qquad
%D  \Pr\biggl( \frac {3}{4} \biggr)
%D \stopformula
%D \stopbuffer
%D \typebuffer
%D
%D which gives (notice the spacing before the parenthesis)
%D
%D \getbuffer
%D
%D I will assume that if \type{text} is something, then
%D the default behaviour is desirable, if \type{text} is empty, then I add
%D \type{\mathopen} and \type{\mathclose}.  Using \type{\mathopen} to correct
%D the spacing is due to Frank Mittelbach, see
%D \hyphenatedurl{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=latex/3853}
%D
%D Mathset module ensures that we get the correct spacing in both cases
%D \startbuffer
%D \definemathset[SET][left=(,right=)]
%D \startformula
%D  2\SET{\frac{3}{4}} \qquad \hbox{ and } \qquad
%D  \PR{ \frac{3}{4} }
%D \stopformula
%D \stopbuffer
%D \getbuffer[PR] \getbuffer which was typed as \typebuffer
%D
%D Also, if its argument is a single character, \type{\mathop} centers it 
to
%D with respect to the math||axis. Compare the outputs of
%D
%D \startbuffer
%D \ruledhbox{$\mathop{y}\nolimits_x\left\{A\,\middle|\,B\right\}$}
%D \ruledhbox{$\mathop{\kern\zeropoint y}\nolimits_x\left\{A\,\middle|\,B\right\}$}
%D \stopbuffer
%D
%D \typebuffer
%D \getbuffer
%D
%D I have added a \type{\kern\zeropoint} to prevent that.


Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2011-05-24 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 11:14 Paul Menzel
2011-05-24 13:25 ` Wolfgang Schuster
2011-05-25 13:46   ` Why is `\P` used for not often used ¶? (was: math: too big space between function and argument) Paul Menzel
2011-05-25 14:27     ` Wolfgang Schuster
2011-05-24 13:56 ` Aditya Mahajan [this message]
2011-05-25 13:52   ` math: too big space between function and argument Paul Menzel
2011-05-25 15:54     ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.02.1105240948260.3669@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).