ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: "Yury G. Kudryashov" <urkud@ya.ru>
Subject: Re: unicode subscripts
Date: Sun, 30 May 2010 15:35:12 +0200	[thread overview]
Message-ID: <4C026990.7080203@wxs.nl> (raw)
In-Reply-To: <htrh34$qk3$1@dough.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]

On 29-5-2010 6:58, Yury G. Kudryashov wrote:
> Hi!
>
> Unicode subscripts do not work (at least, in math):
>
> \starttext
> $a₀₁₂₃₄₅₆₇₈₉₋₌₊$
> \stoptext
>
> prints only "a". The file char-def.lua contains block like this:
>   [0x2080]={
>    category="no",
>    description="SUBSCRIPT ZERO",
>    direction="en",
>    linebreak="al",
>    specials={ "sub", 0x0030 },
>    unicodeslot=0x2080,
>   },
>
> Which file should handle this "specials={ "sub", 0x0030 }"?
>
> P.S.: Superscript digits work. Probably, the font contains ¹ but not ₁.

in which case ... do you expect that glyph? or maybe one special for 
math? and does its size match the other superscripts that are not in the 
font? these super/sub things are historic ballast and not that useful

anyhow, attached a way to deal with it in your document, but you have to 
load it explicitly with \usemodule[mathcrap]

as soon as math-stream interpretation (as for instance in msword) is 
introduced in mkiv i might consider some collapsing mechanism

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

[-- Attachment #2: m-mathcrap.mkiv --]
[-- Type: text/plain, Size: 3654 bytes --]

%D \module
%D   [       file=m-mathcrap,
%D        version=2010.05.30,
%D          title=\CONTEXT\ Modules,
%D       subtitle=Math Crap,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright=PRAGMA ADE]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D This is meant for those who want to use the (incomplete and sort of useless)
%D unicode superscripts and subscripts. We should look ahead and collapse them
%D but I will only implement that in calcmath when the need is there. Now the
%D spacing can be somewhat non optimal but probably that does not matter here.
%D
%D \startbuffer
%D $a₀₁₂₃₄₅₆₇₈₉₋₌₊$
%D \stopbuffer
%D
%D \typebuffer \blank \getbuffer \blank

\unprotect

\unexpanded\def\mathunicodesupercrap#1{\mathortext{{^{#1}}}{\high{#1}}}
\unexpanded\def\mathunicodesubcrap  #1{\mathortext{{_{#1}}}{\low {#1}}}

\ifdefined\installanddefineactivecharacter\else

    \def\installanddefineactivecharacter #1 #2% we need this as command
      {\normalexpanded{\noexpand\installactivecharacter \utfchar{#1} }%
       \defineactivecharacter #1 {#2}}

\fi

\installanddefineactivecharacter "2070 {\mathunicodesupercrap 0}
\installanddefineactivecharacter "00B9 {\mathunicodesupercrap 1}â‚€
\installanddefineactivecharacter "00B2 {\mathunicodesupercrap 2}â‚€
\installanddefineactivecharacter "00B3 {\mathunicodesupercrap 3}â‚€
\installanddefineactivecharacter "2074 {\mathunicodesupercrap 4}
\installanddefineactivecharacter "2075 {\mathunicodesupercrap 5}
\installanddefineactivecharacter "2076 {\mathunicodesupercrap 6}
\installanddefineactivecharacter "2077 {\mathunicodesupercrap 7}
\installanddefineactivecharacter "2078 {\mathunicodesupercrap 8}
\installanddefineactivecharacter "2079 {\mathunicodesupercrap 9}
\installanddefineactivecharacter "207A {\mathunicodesupercrap +}
\installanddefineactivecharacter "207B {\mathunicodesupercrap -}
\installanddefineactivecharacter "207C {\mathunicodesupercrap =}
\installanddefineactivecharacter "207D {\mathunicodesupercrap (}
\installanddefineactivecharacter "207E {\mathunicodesupercrap )}
\installanddefineactivecharacter "207F {\mathunicodesupercrap n}

\installanddefineactivecharacter "2080 {\mathunicodesubcrap   0}
\installanddefineactivecharacter "2081 {\mathunicodesubcrap   1}
\installanddefineactivecharacter "2082 {\mathunicodesubcrap   2}
\installanddefineactivecharacter "2083 {\mathunicodesubcrap   3}
\installanddefineactivecharacter "2084 {\mathunicodesubcrap   4}
\installanddefineactivecharacter "2085 {\mathunicodesubcrap   5}
\installanddefineactivecharacter "2086 {\mathunicodesubcrap   6}
\installanddefineactivecharacter "2087 {\mathunicodesubcrap   7}
\installanddefineactivecharacter "2088 {\mathunicodesubcrap   8}
\installanddefineactivecharacter "2089 {\mathunicodesubcrap   9}
\installanddefineactivecharacter "208A {\mathunicodesubcrap   +}
\installanddefineactivecharacter "208B {\mathunicodesubcrap   -}
\installanddefineactivecharacter "208C {\mathunicodesubcrap   =}
\installanddefineactivecharacter "208D {\mathunicodesubcrap   (}
\installanddefineactivecharacter "208E {\mathunicodesubcrap   )}
\installanddefineactivecharacter "2090 {\mathunicodesubcrap   A}
\installanddefineactivecharacter "2091 {\mathunicodesubcrap   E}
\installanddefineactivecharacter "2092 {\mathunicodesubcrap   O}
\installanddefineactivecharacter "2093 {\mathunicodesubcrap   X}
%installanddefineactivecharacter "2094 {\mathunicodesubcrap   ?} % SCHWAA

\protect \endinput

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2010-05-30 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29 16:58 Yury G. Kudryashov
2010-05-30 13:35 ` Hans Hagen [this message]
2010-05-30 14:52   ` Yury G. Kudryashov
2010-05-30 15:22     ` Hans Hagen
2010-05-30 15:01   ` Khaled Hosny
2010-05-30 15:19     ` Hans Hagen

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=4C026990.7080203@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    --cc=urkud@ya.ru \
    /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).