ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Character alignment in math mode
@ 2014-06-25  0:49 Maggyero
  2014-06-25  7:10 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Maggyero @ 2014-06-25  0:49 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 296 bytes --]

> 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

[-- Attachment #1.2: Type: text/html, Size: 416 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-25  0:49 Character alignment in math mode Maggyero
@ 2014-06-25  7:10 ` Wolfgang Schuster
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2014-06-25  7:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 25.06.2014 um 02:49 schrieb Maggyero <maggyero@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-25 21:35     ` Wolfgang Schuster
@ 2014-06-26 14:22       ` Brian R. Landy
  0 siblings, 0 replies; 12+ messages in thread
From: Brian R. Landy @ 2014-06-26 14:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Wed, 25 Jun 2014, Wolfgang Schuster wrote:

>
> Am 25.06.2014 um 23:20 schrieb Brian R. Landy <brian@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-25 21:20   ` Brian R. Landy
@ 2014-06-25 21:35     ` Wolfgang Schuster
  2014-06-26 14:22       ` Brian R. Landy
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2014-06-25 21:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 25.06.2014 um 23:20 schrieb Brian R. Landy <brian@landy.cx>:

> 
> 
> On Wed, 25 Jun 2014, Wolfgang Schuster wrote:
> 
>> 
>> Am 24.06.2014 um 21:46 schrieb Maggyero <maggyero@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-24 22:29 ` Wolfgang Schuster
  2014-06-25  7:50   ` Hans Hagen
@ 2014-06-25 21:20   ` Brian R. Landy
  2014-06-25 21:35     ` Wolfgang Schuster
  1 sibling, 1 reply; 12+ messages in thread
From: Brian R. Landy @ 2014-06-25 21:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On Wed, 25 Jun 2014, Wolfgang Schuster wrote:

>
> Am 24.06.2014 um 21:46 schrieb Maggyero <maggyero@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-25 13:31 Maggyero
@ 2014-06-25 13:59 ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2014-06-25 13:59 UTC (permalink / raw)
  To: ntg-context

On 6/25/2014 3:31 PM, Maggyero wrote:
>  > \let\Test\fontstylesuffix
>  > a bit different output
>
> Thank you Hans.
>
>  > 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).
>
> Okay Wolfgang, I thought Latin Modern also had greek characters, but
> apparently not. So in math mode which font is used by default if it is
> not Latin Modern greek?

a math font has a greek (math) alphabets which is not the same as text 
greek (it might have different shapes, different kerning properties, 
etc) ... in a similar fashion a math font has sans and monospaced and 
script alphabets

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Character alignment in math mode
@ 2014-06-25 13:31 Maggyero
  2014-06-25 13:59 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Maggyero @ 2014-06-25 13:31 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 399 bytes --]

> \let\Test\fontstylesuffix
> a bit different output

Thank you Hans.

> 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).

Okay Wolfgang, I thought Latin Modern also had greek characters, but
apparently not. So in math mode which font is used by default if it is not
Latin Modern greek?

[-- Attachment #1.2: Type: text/html, Size: 519 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-24 22:29 ` Wolfgang Schuster
@ 2014-06-25  7:50   ` Hans Hagen
  2014-06-25 21:20   ` Brian R. Landy
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2014-06-25  7:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6/25/2014 12:29 AM, Wolfgang Schuster wrote:
>
> Am 24.06.2014 um 21:46 schrieb Maggyero <maggyero@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-24 19:46 Maggyero
@ 2014-06-24 22:29 ` Wolfgang Schuster
  2014-06-25  7:50   ` Hans Hagen
  2014-06-25 21:20   ` Brian R. Landy
  0 siblings, 2 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2014-06-24 22:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 24.06.2014 um 21:46 schrieb Maggyero <maggyero@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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Character alignment in math mode
@ 2014-06-24 19:46 Maggyero
  2014-06-24 22:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Maggyero @ 2014-06-24 19:46 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 795 bytes --]

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

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):

\starttext
\definemathcommand[cool]{{\bfmath cool}}
text mode normal: \cool\crlf
text mode italic: {\it \cool}\crlf
text mode bold: {\bf \cool}\crlf
text mode bolditalic: {\bi \cool}\crlf
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 982 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Character alignment in math mode
  2014-06-24 14:35 Maggyero
@ 2014-06-24 15:55 ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2014-06-24 15:55 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Character alignment in math mode
@ 2014-06-24 14:35 Maggyero
  2014-06-24 15:55 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Maggyero @ 2014-06-24 14:35 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

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


Best regards.

[-- Attachment #1.2: Type: text/html, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-06-26 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  0:49 Character alignment in math mode Maggyero
2014-06-25  7:10 ` Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2014-06-25 13:31 Maggyero
2014-06-25 13:59 ` Hans Hagen
2014-06-24 19:46 Maggyero
2014-06-24 22:29 ` Wolfgang Schuster
2014-06-25  7:50   ` Hans Hagen
2014-06-25 21:20   ` Brian R. Landy
2014-06-25 21:35     ` Wolfgang Schuster
2014-06-26 14:22       ` Brian R. Landy
2014-06-24 14:35 Maggyero
2014-06-24 15:55 ` Hans Hagen

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).