ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Context and metapost: using \frac
@ 2011-04-25 18:33 mat
  2011-04-26  8:37 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: mat @ 2011-04-25 18:33 UTC (permalink / raw)
  To: ntg-context; +Cc: Charlie Sharpsteen


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

Hi

I am using context to run a metapost graph. I am however unable to 
insert a label with \frac, since this is not pure Tex but Latex. This 
seems to be a known problem for metapost:
-Seems for metapost only,  one should add %&latex 
(http://ryanmlayer.wordpress.com/tag/metapost/).
-I saw also one post where it was mentione done should add 
//\setupMPpage[offset=1pt] 
//(http://www.tug.org/pipermail/pdftex/2001-March/000429.html). I tried, 
but did not work however...

Any idea how I should do? Find below minimal example, that does not work 
on my computer when compiling with context...

Thanks!!

Matthieu

\starttext

\setupMPpage[offset=1pt]

\switchtobodyfont[10pt]

% Beginning MetaPost graphic
\startMPpage

label.top(btex 1.4 etex scaled   1.00, (10, 10));

label.top(btex $\sigma_t$ etex scaled   1.00, (0, 10));

label.top(btex $\displaystyle \frac{\sigma_t}{a}$ etex scaled   1.00, 
(1, 1));

\stopMPpage

\stoptext


[-- Attachment #1.2: Type: text/html, Size: 1683 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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-25 18:33 Context and metapost: using \frac mat
@ 2011-04-26  8:37 ` Hans Hagen
  2011-04-26 10:02   ` Matthieu Stigler
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2011-04-26  8:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Charlie Sharpsteen

On 25-4-2011 8:33, mat wrote:

> Any idea how I should do? Find below minimal example, that does not work
> on my computer when compiling with context...

best use textext ...

label.top(textext("1.4")                                scaled 1.00, 
(10, 10));
label.top(textext("$\sigma_t$")                         scaled 1.00, (0, 
10));
label.top(textext("$\displaystyle \frac{\sigma_t}{a}$") scaled 1.00, (1, 
1));

works ok (only tested mkiv); also \frac is available in context

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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26  8:37 ` Hans Hagen
@ 2011-04-26 10:02   ` Matthieu Stigler
  2011-04-26 10:36     ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu Stigler @ 2011-04-26 10:02 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans

Thanks for your quick answer! I was however not able to produce the 
graph with the textext code... Should I actually then use another 
compiler? I tried with context and texexec (I thought texexec is the 
compiler for mkiv, right? I'm on linux ubuntu).

I saw also that, as you mention, context has a \frac: 
http://wiki.contextgarden.net/Math_with_newmat

I tried then to simply add \usemodule[newmat] and compile with context, 
but did not work... Code below, error message below below...

Thanks a  lot!!!!

Matthieu

Code:

\usemodule[newmat]

\starttext

\setupMPpage[offset=1pt]

\switchtobodyfont[10pt]

% Beginning MetaPost graphic

\startMPpage

label.top(btex 1.4 etex scaled   1.00, (10, 10));

label.top(btex $\sigma_t$ etex scaled   1.00, (0, 10));

label.top(btex $\displaystyle \frac{\sigma_t}{a}$ etex scaled   1.00, (0, 10));

\stopMPpage

\stoptext





Error:

! Math error: parameter \Umathfraction_del_size\displaystyle is not set.
l.3 ...t{411}{$\displaystyle \frac {\sigma _t}{a}$
                                                   }
<inserted text> ...ore.mp ; fi ; ;;;]===], false)}

\processMPgraphic ...s ;\!!es , \MPaskedfigure )}}
                                                   \egroup \global 
\MPinstanc...
\dostartMPpage ...??mg ][#1]\processMPgraphic {#3}
                                                   \dostopfittingpage
l.26 \stopMPpage




Le 26/04/2011 10:37, Hans Hagen a écrit :
> On 25-4-2011 8:33, mat wrote:
>
>> Any idea how I should do? Find below minimal example, that does not work
>> on my computer when compiling with context...
>
> best use textext ...
>
> label.top(textext("1.4")                                scaled 1.00, 
> (10, 10));
> label.top(textext("$\sigma_t$")                         scaled 1.00, 
> (0, 10));
> label.top(textext("$\displaystyle \frac{\sigma_t}{a}$") scaled 1.00, 
> (1, 1));
>
> works ok (only tested mkiv); also \frac is available in context
>
> 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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26 10:02   ` Matthieu Stigler
@ 2011-04-26 10:36     ` Hans Hagen
  2011-04-26 11:36       ` Matthieu Stigler
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2011-04-26 10:36 UTC (permalink / raw)
  To: Matthieu Stigler; +Cc: mailing list for ConTeXt users

On 26-4-2011 12:02, Matthieu Stigler wrote:
> Dear Hans
>
> Thanks for your quick answer! I was however not able to produce the
> graph with the textext code... Should I actually then use another
> compiler? I tried with context and texexec (I thought texexec is the
> compiler for mkiv, right? I'm on linux ubuntu).

no, use the 'context' command as texexec is for mkii

> I saw also that, as you mention, context has a \frac:
> http://wiki.contextgarden.net/Math_with_newmat

indeed, \frac is already there for a long time (ams compatible command)

btw, in mkiv there is no m-newmath

> I tried then to simply add \usemodule[newmat] and compile with context,
> but did not work... Code below, error message below below...
> ! Math error: parameter \Umathfraction_del_size\displaystyle is not set.
> l.3 ...t{411}{$\displaystyle \frac {\sigma _t}{a}$
> }
> <inserted text> ...ore.mp ; fi ; ;;;]===], false)}

make sure that a font is loaded that has math before \starttext is seen

(try with \setupbodyfont[palatino] at the top of your file)

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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26 10:36     ` Hans Hagen
@ 2011-04-26 11:36       ` Matthieu Stigler
  2011-04-26 14:33         ` Andreas Harder
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu Stigler @ 2011-04-26 11:36 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


Le 26/04/2011 12:36, Hans Hagen a écrit :
> On 26-4-2011 12:02, Matthieu Stigler wrote:
>> Dear Hans
>>
>> Thanks for your quick answer! I was however not able to produce the
>> graph with the textext code... Should I actually then use another
>> compiler? I tried with context and texexec (I thought texexec is the
>> compiler for mkiv, right? I'm on linux ubuntu).
>
> no, use the 'context' command as texexec is for mkii
>
ok, so I was using the right compiler.... I get a mystake while trying 
to compile a file with the code you sent... you didn't? Would you be so 
nice and send complete file, so I can check what is wrong?


>> I saw also that, as you mention, context has a \frac:
>> http://wiki.contextgarden.net/Math_with_newmat
>
> indeed, \frac is already there for a long time (ams compatible command)

> btw, in mkiv there is no m-newmath
>
>> I tried then to simply add \usemodule[newmat] and compile with context,
>> but did not work... Code below, error message below below...
>> ! Math error: parameter \Umathfraction_del_size\displaystyle is not set.
>> l.3 ...t{411}{$\displaystyle \frac {\sigma _t}{a}$
>> }
>> <inserted text> ...ore.mp ; fi ; ;;;]===], false)}
>
> make sure that a font is loaded that has math before \starttext is seen
>
> (try with \setupbodyfont[palatino] at the top of your file)
>
this does not work neither.... I still get error message with this code:

\usemodule[newmat]

\setupbodyfont[palatino]

\starttext

\startMPpage

label.top(textext("$ \frac{\sigma_t}{a}$") scaled 1.00, (1, 1));

%label.top(btex $ \frac{\sigma_t}{a}$ etex, (0, 10));

%label.top(textext( $\displaystyle \frac{\sigma_t}{a}$ ) scaled   1.00, (1, 1));

\stopMPpage

\stoptext


Thanks a lot for your help!!!!

Matthieu


> 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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26 11:36       ` Matthieu Stigler
@ 2011-04-26 14:33         ` Andreas Harder
  2011-04-26 15:17           ` Matthieu Stigler
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Harder @ 2011-04-26 14:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 26.04.2011 um 13:36 schrieb Matthieu Stigler:

> 
> Le 26/04/2011 12:36, Hans Hagen a écrit :
>> On 26-4-2011 12:02, Matthieu Stigler wrote:
>>> Dear Hans
>>> 
>>> Thanks for your quick answer! I was however not able to produce the
>>> graph with the textext code... Should I actually then use another
>>> compiler? I tried with context and texexec (I thought texexec is the
>>> compiler for mkiv, right? I'm on linux ubuntu).
>> 
>> no, use the 'context' command as texexec is for mkii
>> 
> ok, so I was using the right compiler.... I get a mystake while trying to compile a file with the code you sent... you didn't? Would you be so nice and send complete file, so I can check what is wrong?
> 
> 
>>> I saw also that, as you mention, context has a \frac:
>>> http://wiki.contextgarden.net/Math_with_newmat
>> 
>> indeed, \frac is already there for a long time (ams compatible command)
> 
>> btw, in mkiv there is no m-newmath
>> 
>>> I tried then to simply add \usemodule[newmat] and compile with context,
>>> but did not work... Code below, error message below below...
>>> ! Math error: parameter \Umathfraction_del_size\displaystyle is not set.
>>> l.3 ...t{411}{$\displaystyle \frac {\sigma _t}{a}$
>>> }
>>> <inserted text> ...ore.mp ; fi ; ;;;]===], false)}
>> 
>> make sure that a font is loaded that has math before \starttext is seen
>> 
>> (try with \setupbodyfont[palatino] at the top of your file)
>> 
> this does not work neither.... I still get error message with this code:
> 
> \usemodule[newmat]
> 
> \setupbodyfont[palatino]
> 
> \starttext
> 
> \startMPpage
> 
> label.top(textext("$ \frac{\sigma_t}{a}$") scaled 1.00, (1, 1));
> 
> %label.top(btex $ \frac{\sigma_t}{a}$ etex, (0, 10));
> 
> %label.top(textext( $\displaystyle \frac{\sigma_t}{a}$ ) scaled   1.00, (1, 1));
> 
> \stopMPpage
> 
> \stoptext

Hi,

this works for me.

\setupbodyfont[palatino]

\startMPpage[offset=1ex]
  u := cm ;
  label.top(textext("$ \frac{\sigma_t}{a}$") scaled 2,  origin);
  label.top(textext("$ \frac{\sigma_t}{a}$"),           (u,u));
  label.top(textext("$\dfrac{\sigma_t}{a}$") scaled .5, (u,0));
\stopMPpage

Greeting
	Andreas
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26 14:33         ` Andreas Harder
@ 2011-04-26 15:17           ` Matthieu Stigler
  2011-04-26 15:44             ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu Stigler @ 2011-04-26 15:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Le 26/04/2011 16:33, Andreas Harder a écrit :
> Am 26.04.2011 um 13:36 schrieb Matthieu Stigler:
>
>> Le 26/04/2011 12:36, Hans Hagen a écrit :
>>> On 26-4-2011 12:02, Matthieu Stigler wrote:
>>>> Dear Hans
>>>>
>>>> Thanks for your quick answer! I was however not able to produce the
>>>> graph with the textext code... Should I actually then use another
>>>> compiler? I tried with context and texexec (I thought texexec is the
>>>> compiler for mkiv, right? I'm on linux ubuntu).
>>> no, use the 'context' command as texexec is for mkii
>>>
>> ok, so I was using the right compiler.... I get a mystake while trying to compile a file with the code you sent... you didn't? Would you be so nice and send complete file, so I can check what is wrong?
>>
>>
>>>> I saw also that, as you mention, context has a \frac:
>>>> http://wiki.contextgarden.net/Math_with_newmat
>>> indeed, \frac is already there for a long time (ams compatible command)
>>> btw, in mkiv there is no m-newmath
>>>
>>>> I tried then to simply add \usemodule[newmat] and compile with context,
>>>> but did not work... Code below, error message below below...
>>>> ! Math error: parameter \Umathfraction_del_size\displaystyle is not set.
>>>> l.3 ...t{411}{$\displaystyle \frac {\sigma _t}{a}$
>>>> }
>>>> <inserted text>  ...ore.mp ; fi ; ;;;]===], false)}
>>> make sure that a font is loaded that has math before \starttext is seen
>>>
>>> (try with \setupbodyfont[palatino] at the top of your file)
>>>
>> this does not work neither.... I still get error message with this code:
>>
>> \usemodule[newmat]
>>
>> \setupbodyfont[palatino]
>>
>> \starttext
>>
>> \startMPpage
>>
>> label.top(textext("$ \frac{\sigma_t}{a}$") scaled 1.00, (1, 1));
>>
>> %label.top(btex $ \frac{\sigma_t}{a}$ etex, (0, 10));
>>
>> %label.top(textext( $\displaystyle \frac{\sigma_t}{a}$ ) scaled   1.00, (1, 1));
>>
>> \stopMPpage
>>
>> \stoptext
> Hi,
>
> this works for me.
>
> \setupbodyfont[palatino]
>
> \startMPpage[offset=1ex]
>    u := cm ;
>    label.top(textext("$ \frac{\sigma_t}{a}$") scaled 2,  origin);
>    label.top(textext("$ \frac{\sigma_t}{a}$"),           (u,u));
>    label.top(textext("$\dfrac{\sigma_t}{a}$") scaled .5, (u,0));
> \stopMPpage
>
Andreas

Thanks for answer!

Is this code you wrote supposed to be the whole doc to compile? And 
compiled with context? If yes, I got an error again... I have version
context --version
MTXrun | main context file: /usr/share/texmf/tex/context/base/context.tex
MTXrun | current version: 2009.11.26 16:2

Is it likel;y then that the problem is solved in more recent versions? I 
would try to update then... I am on Ubuntu 10.10 64b, is there a simple 
way to update from other repos, or should I compile?

Thanks for your help!!!

Matthieu


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

___________________________________________________________________________________
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] 8+ messages in thread

* Re: Context and metapost: using \frac
  2011-04-26 15:17           ` Matthieu Stigler
@ 2011-04-26 15:44             ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2011-04-26 15:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 26-4-2011 5:17, Matthieu Stigler wrote:

> MTXrun | current version: 2009.11.26 16:2

that's rather old for a luatex/context combination

on the wiki you can find how to install minimals (takes a few minutes 
only, no compilation needed)

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] 8+ messages in thread

end of thread, other threads:[~2011-04-26 15:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-25 18:33 Context and metapost: using \frac mat
2011-04-26  8:37 ` Hans Hagen
2011-04-26 10:02   ` Matthieu Stigler
2011-04-26 10:36     ` Hans Hagen
2011-04-26 11:36       ` Matthieu Stigler
2011-04-26 14:33         ` Andreas Harder
2011-04-26 15:17           ` Matthieu Stigler
2011-04-26 15:44             ` 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).