ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Khaled Hosny <khaledhosny@eglug.org>
To: Hans Hagen <pragma@wxs.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Jeong Dal <haksan@me.com>
Subject: Re: \not\in doesn't work properly
Date: Tue, 4 Dec 2012 17:18:55 +0200	[thread overview]
Message-ID: <20121204151855.GF10913@khaled-laptop> (raw)
In-Reply-To: <50BD068F.2050308@wxs.nl>

On Mon, Dec 03, 2012 at 09:07:43PM +0100, Hans Hagen wrote:
> On 11/30/2012 10:26 AM, Jeong Dal wrote:
> >Hi,
> >
> >After updating ConTeXt, math command '\not\in' is not shown properly.
> >
> >For example,
> >
> >$a \not\eq b$ is good.
> >
> >but $a \not\in A$ shows two symbols separately.
> >
> >
> >I am using Mac OS X 10.8 and the versions of LuaTex and ConTeXt are
> >
> >This is LuaTeX, Version beta-0.70.2-2012052309 (TeX Live 2012)
> >ConTeXt ver: 2012.11.23 17:35 MKIV fmt: 2012.11.26 int: english/english
> 
> I assume that you use lm ... before I start looking into it I'd like
> to know Khaleds point of view on this.

The main issue here is that \not in was largely a hack in CM fonts, the
glyph was specially crafted so that it overlays the next symbol by
having zero width and -ve right side bearing and it was centered over
equal and similar symbols, anything with different width would not look
good.

This can't be relied on with OpenType fonts mainly because we don't
control all the fonts and since U+0338 is a combining mark it tends to
have -ve left side bearing (the opposite of CM).

Previously I thought it should be handled as special math accent that
don't get shifted above, but this didn't work because accent noads do
not inherit the spacing of their nuclei, and changing this is not simple
AFAICT. When I checked Word it had no notion of negations either, you
can only use pre-composed negated symbols (but accents respect the
spacing of its accentee, BTW).

The solution currently used by unicode-math package is to look ahead and
see if the next symbol after \not has a precomposed negated form and use
it (such a list can be obtained by checking Unicode characters that
decompose to something + U+0338), else just output U+0338. This probably
can be even enhanced by inserting a kern between \not and the next
symbol that would center their bounding boxes together, to handle cases
why no precomposed symbol exists. My be we need a new primitive
\Unegation that would do this in the engine?

Regards,
Khaled
___________________________________________________________________________________
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:[~2012-12-04 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30  9:26 Jeong Dal
2012-12-03 20:07 ` Hans Hagen
2012-12-03 21:26   ` Otared Kavian
2012-12-03 22:02     ` Hans Hagen
2012-12-04  4:33   ` Jeong Dal
2012-12-04 15:18   ` Khaled Hosny [this message]
2012-12-04 15:33     ` luigi scarso
2012-12-04 16:10       ` Hans Hagen
2012-12-04 16:38     ` Hans Hagen
2012-12-04 21:01       ` Otared Kavian
2012-12-05  9:18         ` Hans Hagen
2012-12-05 15:48 Jeong Dal

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=20121204151855.GF10913@khaled-laptop \
    --to=khaledhosny@eglug.org \
    --cc=haksan@me.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.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).