Re: [NTG-context] Character alignment in math mode

2014-06-26 Thread Brian R. Landy



On Wed, 25 Jun 2014, Wolfgang Schuster wrote:



Am 25.06.2014 um 23:20 schrieb Brian R. Landy br...@landy.cx:

Out of curiosity, how do you do that (i.e., revert back to lining, 
and tabular, figures in a table, or even in running text)?


For example, if I do this:

   \starttext
   \bf 12345\par
   \tf 12345\par
   \stoptext

the first line is bold but the second is not.  But if I do the same 
with \os:


   \starttext
   \os 12345\par
   \tf 12345\par
   \stoptext

both lines use old style numbers.  Is there a way to switch the 
current font back to lining figures without reloading the font with 
\switchtobodyfont or something similar?



The \os command enables oldstyle figures in your font and the setting 
isn’t reset when you switch to a different font alternative.


\definefontfeature[f:lnum][lnum=yes]
\definefontfeature[f:onum][onum=yes]
\definefontfeature[f:tnum][tnum=yes,pnum=no]
\definefontfeature[f:pnum][pnum=yes,tnum=no]

\setupbodyfont[antykwa-poltawskiego]

\starttext

\starttabulate
\NC onum\NC \feature[+][f:onum]   1234567890 
\NC\NR
\NC onum + tnum \NC \feature[+][f:onum]\feature[+][f:tnum]1234567890 
\NC\NR
\NC onum + pnum \NC \feature[+][f:onum]\feature[+][f:pnum]1234567890 
\NC\NR

\TB
\NC lnum\NC \feature[+][f:lnum]   1234567890 
\NC\NR
\NC lnum + tnum \NC \feature[+][f:lnum]\feature[+][f:tnum]1234567890 
\NC\NR
\NC lnum + pnum \NC \feature[+][f:lnum]\feature[+][f:pnum]1234567890 
\NC\NR

\stoptabulate

\stoptext

Wolfgang


This was exactly what I needed, thank you!

Brian
___
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
___


Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 02:49 schrieb Maggyero maggy...@gmail.com:

  You can access the current font alternative with the \fontalternative 
  command
 
 Thanks Wolfgang, that was exactly the command I was looking for!
 
 A last question: how can one get italic greek in TEXT MODE? The following 
 code displays upright greek.
 
 \starttext
 \mathgreekitalic \alpha
 \stoptext

The command \mathgreekitalic can only be used in math mode, when you want a 
italic alpha
in text mode you need a font which has greek characters (e.g. Gentium).

\definetypeface [mainface] [rm] [serif] [gentium] [default]
\definetypeface [mainface] [mm] [math]  [xits][default]

\setupbodyfont[mainface]

\starttext
α {\it α} \quad \m{\alpha \mathgreekupright \alpha \mathgreekitalic \alpha}
\stoptext

Wolfgang

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

Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Hans Hagen

On 6/25/2014 12:29 AM, Wolfgang Schuster wrote:


Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:


why  use math here?


It was to avoid oldstyle figures that I use by default. But finally it's better 
to use oldstyle figures even in tables.


You can enable lining (and tabular) figures in the table when you don’t want 
oldstyle figures.


Another question about fonts. Is there a way to define a conditional 
mathcommand based on the current alternative style? For instance, in the 
following example I would like to keep the bold effect but with adaptation to 
the local alternative style (in text mode, when the local alternative style is 
\tf I would like the mathcommand to be \bf, when it is \it I would like \bi, 
when it is \bf I would like \bf and when it is \bi I would like still \bi):


You can access the current font alternative with the \fontalternative command 
(below is a old example I wrote a few months ago).

\def\Test
   {\processaction
  [\fontalternative]
 [ tf=Upright,
it=Italic,
sl=Slanted,
bf=Bold,
bi=Bolditalic,
bs=Boldslanted,
   unknown=Unknown fontalternative]}

\starttext
“\Test” {\it “\Test”} {\bs “\Test”} {\sc “\Test”}
\stoptext


\let\Test\fontstylesuffix

a bit different output

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


Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Brian R. Landy



On Wed, 25 Jun 2014, Wolfgang Schuster wrote:



Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:


why  use math here?


It was to avoid oldstyle figures that I use by default. But finally 
it's better to use oldstyle figures even in tables.


You can enable lining (and tabular) figures in the table when you 
don’t want oldstyle figures.


Out of curiosity, how do you do that (i.e., revert back to lining, and 
tabular, figures in a table, or even in running text)?


For example, if I do this:

\starttext
\bf 12345\par
\tf 12345\par
\stoptext

the first line is bold but the second is not.  But if I do the same with 
\os:


\starttext
\os 12345\par
\tf 12345\par
\stoptext

both lines use old style numbers.  Is there a way to switch the current 
font back to lining figures without reloading the font with 
\switchtobodyfont or something similar?


Thanks,
Brian
___
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
___


Re: [NTG-context] Character alignment in math mode

2014-06-25 Thread Wolfgang Schuster

Am 25.06.2014 um 23:20 schrieb Brian R. Landy br...@landy.cx:

 
 
 On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
 
 
 Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:
 
 why  use math here?
 
 It was to avoid oldstyle figures that I use by default. But finally it's 
 better to use oldstyle figures even in tables.
 
 You can enable lining (and tabular) figures in the table when you don’t want 
 oldstyle figures.
 
 Out of curiosity, how do you do that (i.e., revert back to lining, and 
 tabular, figures in a table, or even in running text)?
 
 For example, if I do this:
 
\starttext
\bf 12345\par
\tf 12345\par
\stoptext
 
 the first line is bold but the second is not.  But if I do the same with \os:
 
\starttext
\os 12345\par
\tf 12345\par
\stoptext
 
 both lines use old style numbers.  Is there a way to switch the current font 
 back to lining figures without reloading the font with \switchtobodyfont or 
 something similar?


The \os command enables oldstyle figures in your font and the setting isn’t 
reset when you switch to a different font alternative.

\definefontfeature[f:lnum][lnum=yes]
\definefontfeature[f:onum][onum=yes]
\definefontfeature[f:tnum][tnum=yes,pnum=no]
\definefontfeature[f:pnum][pnum=yes,tnum=no]

\setupbodyfont[antykwa-poltawskiego]

\starttext

\starttabulate
\NC onum\NC \feature[+][f:onum]   1234567890 \NC\NR
\NC onum + tnum \NC \feature[+][f:onum]\feature[+][f:tnum]1234567890 \NC\NR
\NC onum + pnum \NC \feature[+][f:onum]\feature[+][f:pnum]1234567890 \NC\NR
\TB
\NC lnum\NC \feature[+][f:lnum]   1234567890 \NC\NR
\NC lnum + tnum \NC \feature[+][f:lnum]\feature[+][f:tnum]1234567890 \NC\NR
\NC lnum + pnum \NC \feature[+][f:lnum]\feature[+][f:pnum]1234567890 \NC\NR
\stoptabulate

\stoptext

Wolfgang
___
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
___


Re: [NTG-context] Character alignment in math mode

2014-06-24 Thread Hans Hagen

On 6/24/2014 4:35 PM, Maggyero wrote:

How can one use character alignment in math mode? (I am using the last
stable ConTeXt version — 2014.05.21.)


\starttext
\setupTABLE[column][first][alignmentcharacter={,}, aligncharacter=yes,
align=middle]

Figures in text mode get aligned:

\startTABLE
 \NC 0,0 \NC \NR
 \NC 0,00\NC \NR
 \NC 0,000   \NC \NR
\stopTABLE

But figures in math mode do not get aligned:

\startTABLE
 \NC $0,0$   \NC \NR
 \NC $0,00$  \NC \NR
 \NC $0,000$ \NC \NR
\stopTABLE
\stoptext


indeed, as math node lists have a completely different structure ... why 
use math here?


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


Re: [NTG-context] Character alignment in math mode

2014-06-24 Thread Wolfgang Schuster

Am 24.06.2014 um 21:46 schrieb Maggyero maggy...@gmail.com:

  why  use math here?
 
 It was to avoid oldstyle figures that I use by default. But finally it's 
 better to use oldstyle figures even in tables.

You can enable lining (and tabular) figures in the table when you don’t want 
oldstyle figures.

 Another question about fonts. Is there a way to define a conditional 
 mathcommand based on the current alternative style? For instance, in the 
 following example I would like to keep the bold effect but with adaptation to 
 the local alternative style (in text mode, when the local alternative style 
 is \tf I would like the mathcommand to be \bf, when it is \it I would like 
 \bi, when it is \bf I would like \bf and when it is \bi I would like still 
 \bi):

You can access the current font alternative with the \fontalternative command 
(below is a old example I wrote a few months ago).

\def\Test
  {\processaction
 [\fontalternative]
 [ tf=Upright,
   it=Italic,
   sl=Slanted,
   bf=Bold,
   bi=Bolditalic,
   bs=Boldslanted,
  unknown=Unknown fontalternative]}
  
\starttext
“\Test” {\it “\Test”} {\bs “\Test”} {\sc “\Test”}
\stoptext

Wolfgang

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