ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* International characters in math
@ 2005-06-28  3:42 Radhelorn
  2005-06-28  6:44 ` Wolfgang Zillig
  2005-06-28  7:28 ` Hans Hagen
  0 siblings, 2 replies; 11+ messages in thread
From: Radhelorn @ 2005-06-28  3:42 UTC (permalink / raw)


Hello All!
I've returned to my experiments with fonts and have a question: is there 
a way to use international characters in math like with LaTeX mathtext 
package? Or even as \text{} in AMS LaTeX?

Is there some documentation on math in ConTeXt except sources?

-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: International characters in math
  2005-06-28  3:42 International characters in math Radhelorn
@ 2005-06-28  6:44 ` Wolfgang Zillig
  2005-06-28  7:28 ` Hans Hagen
  1 sibling, 0 replies; 11+ messages in thread
From: Wolfgang Zillig @ 2005-06-28  6:44 UTC (permalink / raw)


Radhelorn wrote:

> Hello All!
> I've returned to my experiments with fonts and have a question: is 
> there a way to use international characters in math like with LaTeX 
> mathtext package? Or even as \text{} in AMS LaTeX?
>
> Is there some documentation on math in ConTeXt except sources?
>
Hello,
There are more ways to typset formulas in context. One is to use mathml, 
but there is a module called newmat (\usemodule[newmat]) and this is the 
way I use math in context. And there is it possible to use \text{}. 
International characters should not be a problem then.

Hope that helps you!

Wolfgang

Here a short example how to use math with this module(you can use inline 
math with $ some math $ ):

\startformula
q = \delta \frac{{\partial p}}{{\partial x}} = \delta (\phi )p_{vsat} 
(\theta )\frac{{\partial \phi }}{{\partial x}} = \left[ {\frac{{\delta 
_a }}{{\mu (\theta )}}p_{vsat} (\theta )} \right]\frac{{\partial \phi 
}}{{\partial x}} = k\frac{{\partial \phi }}{{\partial x}}
\stopformula

\startlegend
\leg k \\ water vapor permeability \\ \\
\leg K \\ water vapor permance \\ \\
\leg S \\ surface \\ \\
\leg L \\ length \\ \\
\stoplegend

Aligning is also possible:

\startformula\eqalign{
t_{L,early} & = t_{L,late} = t_{L,ray} \cr
 & = 6\ \mu m \cr
}\stopformula

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

* Re: International characters in math
  2005-06-28  3:42 International characters in math Radhelorn
  2005-06-28  6:44 ` Wolfgang Zillig
@ 2005-06-28  7:28 ` Hans Hagen
  2005-06-28 17:40   ` Radhelorn
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2005-06-28  7:28 UTC (permalink / raw)


Radhelorn wrote:
> Hello All!
> I've returned to my experiments with fonts and have a question: is there 
> a way to use international characters in math like with LaTeX mathtext 
> package? Or even as \text{} in AMS LaTeX?
> 
> Is there some documentation on math in ConTeXt except sources?

\starttext

compare $\hbox{\'e\'erste}$ and $\hbox{\tf \'e\'erste}$ and $\mbox{\'e\'erste}$

\stoptext

what you get depends on the encoding of the font in use, here you'l get

compare garbage and okay and okay

so, you don't need any additional package

Hans


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

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

* Re: International characters in math
  2005-06-28  7:28 ` Hans Hagen
@ 2005-06-28 17:40   ` Radhelorn
  2005-06-28 19:46     ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Radhelorn @ 2005-06-28 17:40 UTC (permalink / raw)


Hans Hagen wrote:
>> I've returned to my experiments with fonts and have a question: is 
>> there a way to use international characters in math like with LaTeX 
>> mathtext package? Or even as \text{} in AMS LaTeX?
>>
> compare $\hbox{\'e\'erste}$ and $\hbox{\tf \'e\'erste}$ and 
> $\mbox{\'e\'erste}$
>
> what you get depends on the encoding of the font in use, here you'l get
> compare garbage and okay and okay
> 
> so, you don't need any additional package
> 
> Hans
> 

Thanks Hans, Wolfgang for your advice. \mbox and \text in newmath solves 
some problems like units, but what if I want bold roman math with 
international characters (or my own fonts) by default?

I'm trying to figure it out from sources, but it's very long and hard way.


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: International characters in math
  2005-06-28 17:40   ` Radhelorn
@ 2005-06-28 19:46     ` Hans Hagen
  2005-06-29 13:42       ` Radhelorn
  2005-07-01 13:16       ` Mojca Miklavec
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2005-06-28 19:46 UTC (permalink / raw)


Radhelorn wrote:
> Hans Hagen wrote:
> 
>>> I've returned to my experiments with fonts and have a question: is 
>>> there a way to use international characters in math like with LaTeX 
>>> mathtext package? Or even as \text{} in AMS LaTeX?
>>>
>> compare $\hbox{\'e\'erste}$ and $\hbox{\tf \'e\'erste}$ and 
>> $\mbox{\'e\'erste}$
>>
>> what you get depends on the encoding of the font in use, here you'l get
>> compare garbage and okay and okay
>>
>> so, you don't need any additional package
>>
>> Hans
>>
> 
> Thanks Hans, Wolfgang for your advice. \mbox and \text in newmath solves 
> some problems like units, but what if I want bold roman math with 
> international characters (or my own fonts) by default?
> 
> I'm trying to figure it out from sources, but it's very long and hard way.

$\hbox{\tf \'e\'erste}$ and $\mbox{\'e\'erste}$

$\hbox{\bf \'e\'erste}$ and $\mbox{\bf\'e\'erste}$


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

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

* Re: International characters in math
  2005-06-28 19:46     ` Hans Hagen
@ 2005-06-29 13:42       ` Radhelorn
  2005-07-01 13:16       ` Mojca Miklavec
  1 sibling, 0 replies; 11+ messages in thread
From: Radhelorn @ 2005-06-29 13:42 UTC (permalink / raw)


Hans Hagen wrote:
>> Thanks Hans, Wolfgang for your advice. \mbox and \text in newmath 
>> solves some problems like units, but what if I want bold roman math 
>> with international characters (or my own fonts) by default?
>>
> 
> $\hbox{\tf \'e\'erste}$ and $\mbox{\'e\'erste}$
> 
> $\hbox{\bf \'e\'erste}$ and $\mbox{\bf\'e\'erste}$
> 

Thanks Hans, Mojca, I've solved my problems by adjusting a typescript 
file. I will return to the experiments later.


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: International characters in math
  2005-06-28 19:46     ` Hans Hagen
  2005-06-29 13:42       ` Radhelorn
@ 2005-07-01 13:16       ` Mojca Miklavec
  2005-07-01 15:02         ` Adam Lindsay
  2005-07-02 11:01         ` Radhelorn
  1 sibling, 2 replies; 11+ messages in thread
From: Mojca Miklavec @ 2005-07-01 13:16 UTC (permalink / raw)


I also ran into two problems concerning accented math while
experimenting a bit (see below).

Hans Hagen wrote:
> Radhelorn wrote:
> > Thanks Hans, Wolfgang for your advice. \mbox and \text in newmath solves
> > some problems like units, but what if I want bold roman math with
> > international characters (or my own fonts) by default?

To enable bold math by default write:
    \definetypeface[somename][mm][boldmath][latin-modern][default][rscale=1]
    % optional parameter rscale may be any number

followed by
    \setupbodyfont[somename]

if you want some other font, for example euler, choose one of the
following lines:
    %\definetypeface[somename][mm][math][euler][euler]
    %\definetypeface[somename][mm][boldmath][euler][euler]

But what exactly do you mean by bold math with accented characters?
You can either typeset in mathmode, where you use \hat, \check,
\acute, \grave, \bar, \vec, \dot, \ddot, \breve, \tilde or any other
accent that you compose by yourself (poor results for accented
characters, anyway). You can then set bold math to be the default. Or
you can switch to text mode inside math using \hbox{...} as Hans
described. If you want bold inside \hbox{...}, you probably have to
define it in every \hbox manually or use bold font as default in the
whole document.
(If I'm wrong, please correct me.)

Accented characters should work everywhere inside text mode as long as
I understand. But quite some effort was put into ConTeXt to enable
more advanced features regarding fonts, so it may be that ConTeXt
sometimes accidentally fails to produce the desired result. Send an
example if you think that it is causing troubles.

> > I'm trying to figure it out from sources, but it's very long and hard way.
> 
> $\hbox{\tf \'e\'erste}$ and $\mbox{\'e\'erste}$

Is there any special reason that we have to write $\hbox{\tf ...}$?

In plain TeX $\hbox{\v{c}}$ works just fine, while ConTeXt runs into
the same kind of problems as last time with accented characters in
MathML.

-------------------------------------------------------------------------------------------

Can someone please try this:

\definetypeface[somename][mm][math][euler][euler]
\setupbodyfont[somename]
\starttext
$$\sqrt{\acute{a}+\bar{b}+\dot{c}}$$
\stoptext

I don't get any accents. Am I doing something wrong?

Mojca

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

* Re: International characters in math
  2005-07-01 13:16       ` Mojca Miklavec
@ 2005-07-01 15:02         ` Adam Lindsay
  2005-07-02 11:24           ` Radhelorn
  2005-07-02 11:01         ` Radhelorn
  1 sibling, 1 reply; 11+ messages in thread
From: Adam Lindsay @ 2005-07-01 15:02 UTC (permalink / raw)


Mojca Miklavec said this at Fri, 1 Jul 2005 15:16:47 +0200:

>\definetypeface[somename][mm][math][euler][euler]
>\setupbodyfont[somename]
>\starttext
>$$\sqrt{\acute{a}+\bar{b}+\dot{c}}$$
>\stoptext
>
>I don't get any accents. Am I doing something wrong?

No, I am.

You can verify further by adding:
\loadmapfile[original-ams-base]
\showmathcharacters

The normal text-ish accents are not present in the eulervm fonts. I
suppose the rationale is that these are never to be used for text (but
it becomes questionable when you don't have an overbar or dot!) 

I have tried to figure out how to get them from other fonts, but am at a
loss, in terms of the general case.

No one has mentioned it before now, so I didn't try that hard. :) 

Anyone have any suggestions on what approach to take, or what they'd
like to see?
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Re: International characters in math
  2005-07-01 13:16       ` Mojca Miklavec
  2005-07-01 15:02         ` Adam Lindsay
@ 2005-07-02 11:01         ` Radhelorn
  1 sibling, 0 replies; 11+ messages in thread
From: Radhelorn @ 2005-07-02 11:01 UTC (permalink / raw)


Mojca Miklavec wrote:
> To enable bold math by default write: 
> \definetypeface[somename][mm][boldmath][latin-modern][default][rscale=1]
>  % optional parameter rscale may be any number
> 
> followed by \setupbodyfont[somename]
> 
> if you want some other font, for example euler, choose one of the 
> following lines: %\definetypeface[somename][mm][math][euler][euler] 
> %\definetypeface[somename][mm][boldmath][euler][euler]

Thanks for example. We're on the same way now ;-).

> But what exactly do you mean by bold math with accented characters? 

I meant not accented, but other alphabet (cyrillic in my case). Accented 
characters are composed from others, which is another case.

> Is there any special reason that we have to write $\hbox{\tf ...}$?

Well, AFAIK in \mbox there is switch \mf (for 'math font'), which 
switches last font alternative even for math symbols.


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: International characters in math
  2005-07-01 15:02         ` Adam Lindsay
@ 2005-07-02 11:24           ` Radhelorn
  2005-07-05 13:46             ` Adam Lindsay
  0 siblings, 1 reply; 11+ messages in thread
From: Radhelorn @ 2005-07-02 11:24 UTC (permalink / raw)


Adam Lindsay wrote:
>>\definetypeface[somename][mm][math][euler][euler]
>>\setupbodyfont[somename]
>>\starttext
>>$$\sqrt{\acute{a}+\bar{b}+\dot{c}}$$
>>\stoptext
>>
>>I don't get any accents. Am I doing something wrong?
> 
> 
> No, I am.
> 
> You can verify further by adding:
> \loadmapfile[original-ams-base]
> \showmathcharacters
> 
> The normal text-ish accents are not present in the eulervm fonts. I
> suppose the rationale is that these are never to be used for text (but
> it becomes questionable when you don't have an overbar or dot!) 
> 
> I have tried to figure out how to get them from other fonts, but am at a
> loss, in terms of the general case.
> 
> No one has mentioned it before now, so I didn't try that hard. :) 
> 
> Anyone have any suggestions on what approach to take, or what they'd
> like to see?

Apart from creating some new virtual euler font with accents I can not 
see any solution. Beforementioned commands (\acute ...) do not work in 
\mbox and \hbox in math mode (writes about '{' and '}' missing).

Another strange thing. After this sequence:

\usetypescript [modern-base] [t2a] % just for example
\setupbodyfont [modern]

\definetypeface[mytf][mm][math][euler][euler]

\startbuffer
$$\sqrt{\acute{a}+\bar{b}+\dot{c}}$$
\stopbuffer

\starttext
\getbuffer
\switchtobodyfont[mytf]
\getbuffer
\switchtobodyfont[modern]
\getbuffer
\stoptext

Third formula remains roman. Why so?


-- 
Radhelorn <radhelorn@mail.ru>

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

* Re: International characters in math
  2005-07-02 11:24           ` Radhelorn
@ 2005-07-05 13:46             ` Adam Lindsay
  0 siblings, 0 replies; 11+ messages in thread
From: Adam Lindsay @ 2005-07-05 13:46 UTC (permalink / raw)


Radhelorn said this at Sat, 2 Jul 2005 15:24:51 +0400:

>Another strange thing. After this sequence:
>
>\usetypescript [modern-base] [t2a] % just for example
>\setupbodyfont [modern]
>
>\definetypeface[mytf][mm][math][euler][euler]
>
>\startbuffer
>$$\sqrt{\acute{a}+\bar{b}+\dot{c}}$$
>\stopbuffer
>
>\starttext
>\getbuffer
>\switchtobodyfont[mytf]
>\getbuffer
>\switchtobodyfont[modern]
>\getbuffer
>\stoptext
>
>Third formula remains roman. Why so?

I dunno.
I might be tempted to call it a bug...
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

end of thread, other threads:[~2005-07-05 13:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-28  3:42 International characters in math Radhelorn
2005-06-28  6:44 ` Wolfgang Zillig
2005-06-28  7:28 ` Hans Hagen
2005-06-28 17:40   ` Radhelorn
2005-06-28 19:46     ` Hans Hagen
2005-06-29 13:42       ` Radhelorn
2005-07-01 13:16       ` Mojca Miklavec
2005-07-01 15:02         ` Adam Lindsay
2005-07-02 11:24           ` Radhelorn
2005-07-05 13:46             ` Adam Lindsay
2005-07-02 11:01         ` Radhelorn

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