ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metapost/Metafun/Tex/Context question
@ 2006-07-19 12:06 WN
  2006-07-19 12:59 ` Hans Hagen
  2006-07-19 14:00 ` Aditya Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: WN @ 2006-07-19 12:06 UTC (permalink / raw)


Hi all,

I am trying to do the following in Metapost but my new math symbol  is 
not recognized.
Context knows about it but Tex does not.

How can I make this work ?

Kind regards
Wim Neimeijer

% ================= Test code ========================
\loadmapfile[original-youngryu-tx.map]
\definebodyfont [28pt,24pt,18pt,
  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
  mc=txexa sa 1]

\setupbodyfont [11pt]
\definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]

\starttext
\startformula
\varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula
\startMPcode
    picture p ;
    path q;
    numeric u;

    u := 1cm;

    p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
    p := p scaled 0.15cm;
    draw p;
\stopMPcode
\stoptext

=============== Log file ==============================
 >texmfstart texexec --autopdf --pdf testvaroint.tex
TeXExec | processing document 'testvaroint.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | writing option file testvaroint.top
TeXExec | using randomseed 1260
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
 \write18 enabled.
 (f:\context\usr\local\context\tex\texmf-local/web2c/natural.tcx)
entering extended mode
(./testvaroint.tex

ConTeXt  ver: 2006.07.14 12:08  fmt: 2006.7.14  int: english  mes: english

language        : language en is active
<protectionstate 0>
system          : cont-new loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
color           : palette rollover is available
)
system          : cont-old loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
loading         : Context Old Macros
)
system          : cont-fil loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-fil.tex
loading         : Context File Synonyms
)
system          : cont-sys loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/user/cont-sys.tex)
bodyfont        : 12pt rm is loaded
language        : patterns nl->texnansi:texnansi->1->2:3 
nl->ec:ec->2->2:3 fr->
texnansi:texnansi->3->2:3 fr->ec:ec->4->2:3 
de->texnansi:texnansi->5->2:3 de->e
c:ec->6->2:3 it->texnansi:texnansi->7->2:3 it->ec:ec->8->2:3 
pt->texnansi:texna
nsi->9->2:3 pt->ec:ec->10->2:3 hr->ec:ec->11->2:3 pl->pl0:pl0->12->2:3 
pl->ec:e
c->13->2:3 pl->qx:qx->14->2:3 cz->il2:il2->15->2:3 cz->ec:ec->16->2:3 
sk->il2:i
l2->17->2:3 sk->ec:ec->18->2:3 sl->ec:ec->19->2:3 en->ec:ec->21->2:3 
uk->ec:ec-
 >22->2:3 us->ec:ec->23->2:3 agr->agr:agr->24->2:3 da->ec:ec->25->2:3 
sv->ec:ec-
 >26->2:3 af->ec:ec->27->2:3 no->ec:ec->28->2:3 deo->ec:ec->29->2:3 
es->ec:ec->3
0->2:3 ca->ec:ec->31->2:3 la->ec:ec->32->2:3 ro->ec:ec->33->2:3 
tr->ec:ec->34->
2:3 fi->ec:ec->36->2:3 hu->ec:ec->37->2:3 loaded
specials        : tex,postscript,rokicki loaded
system          : testvaroint.top loaded
(./testvaroint.top
specials        : loading definition file tpd
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-tpd.tex
specials        : loading definition file fdf
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.tex)
specials        : fdf loaded
)
specials        : fdf,tpd loaded
)
systems         : system commands are enabled
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/pdfr-ec.tex)
(./testvaroint.tuo) (./testvaroint.tuo) (./testvaroint.tuo) 
(./testvaroint.tuo)
(./testvaroint.tuo) (./testvaroint.tuo) (./testvaroint.tuo) 
(./testvaroint.tuo)
(./testvaroint.tuo) (./testvaroint.tuo)
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-def.tex)
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-lan.tex)
(./testvaroint.tuo) (./testvaroint.tuo)TeXExec | processing graphic 
'testvaroint-mpgraph'
TeXExec | using internal mptotex converter
TeXExec | processing document 'testvaroint-mpgraph-temp.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | writing option file testvaroint-mpgraph-temp.top
TeXExec | using randomseed 447
TeXExec | tex engine: pdfetex
TeXExec | tex format: cont-en
TeXExec | progname: context
This is pdfeTeX, Version 3.141592-1.30.3-2.2 (Web2c 7.5.5)
 \write18 enabled.
 (f:\context\usr\local\context\tex\texmf-local/web2c/natural.tcx)
entering extended mode
(./testvaroint-mpgraph-temp.tex

ConTeXt  ver: 2006.07.14 12:08  fmt: 2006.7.14  int: english  mes: english

language        : language en is active
<protectionstate 0>
system          : cont-new loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
color           : palette rollover is available
)
system          : cont-old loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
loading         : Context Old Macros
)
system          : cont-fil loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/cont-fil.tex
loading         : Context File Synonyms
)
system          : cont-sys loaded
(f:\context\usr\local\context\tex\texmf-local/tex/context/user/cont-sys.tex)
bodyfont        : 12pt rm is loaded
language        : patterns nl->texnansi:texnansi->1->2:3 
nl->ec:ec->2->2:3 fr->
texnansi:texnansi->3->2:3 fr->ec:ec->4->2:3 
de->texnansi:texnansi->5->2:3 de->e
c:ec->6->2:3 it->texnansi:texnansi->7->2:3 it->ec:ec->8->2:3 
pt->texnansi:texna
nsi->9->2:3 pt->ec:ec->10->2:3 hr->ec:ec->11->2:3 pl->pl0:pl0->12->2:3 
pl->ec:e
c->13->2:3 pl->qx:qx->14->2:3 cz->il2:il2->15->2:3 cz->ec:ec->16->2:3 
sk->il2:i
l2->17->2:3 sk->ec:ec->18->2:3 sl->ec:ec->19->2:3 en->ec:ec->21->2:3 
uk->ec:ec-
 >22->2:3 us->ec:ec->23->2:3 agr->agr:agr->24->2:3 da->ec:ec->25->2:3 
sv->ec:ec-
 >26->2:3 af->ec:ec->27->2:3 no->ec:ec->28->2:3 deo->ec:ec->29->2:3 
es->ec:ec->3
0->2:3 ca->ec:ec->31->2:3 la->ec:ec->32->2:3 ro->ec:ec->33->2:3 
tr->ec:ec->34->
2:3 fi->ec:ec->36->2:3 hu->ec:ec->37->2:3 loaded
specials        : tex,postscript,rokicki loaded
system          : testvaroint-mpgraph-temp.top loaded
(./testvaroint-mpgraph-temp.top
specials        : loading definition file dvi
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-dvi.tex)
specials        : tex loaded
specials        : loading definition file ps
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-ps.tex)
specials        : tex,postscript loaded
specials        : loading definition file tr
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/spec-tr.tex)
specials        : tex,postscript,rokicki loaded
)
systems         : system commands are enabled
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-def.tex)
(f:\context\usr\local\context\tex\texmf-local/tex/context/base/sort-lan.tex)
systems         : begin file testvaroint-mpgraph-temp at line 39
! Undefined control sequence.
<recently read> \varointctrclockwise
                                    
l.45 $\varointctrclockwise
                           _{\gamma } f(z) \: dz = 0$%
?

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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 12:06 Metapost/Metafun/Tex/Context question WN
@ 2006-07-19 12:59 ` Hans Hagen
  2006-07-19 13:16   ` Taco Hoekwater
  2006-07-19 14:01   ` WN
  2006-07-19 14:00 ` Aditya Mahajan
  1 sibling, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2006-07-19 12:59 UTC (permalink / raw)


WN wrote:
> Hi all,
>
> I am trying to do the following in Metapost but my new math symbol  is 
> not recognized.
> Context knows about it but Tex does not.
>
> How can I make this work ?
>
> Kind regards
> Wim Neimeijer
>
> % ================= Test code ========================
> \loadmapfile[original-youngryu-tx.map]
> \definebodyfont [28pt,24pt,18pt,
>   17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>   mc=txexa sa 1]
>
> \setupbodyfont [11pt]
> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>
> \starttext
> \startformula
> \varointctrclockwise_{\gamma} f(z) \: dz = 0
> \stopformula
> \startMPcode
>     picture p ;
>     path q;
>     numeric u;
>
>     u := 1cm;
>
>     p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
>     p := p scaled 0.15cm;
>     draw p;
> \stopMPcode
> \stoptext
>   
make sure that mp knows about the definitions: 

- first extend the math collection (use decimen, since there is a linesplit bug with " here) 
- then load the times font 
- somehow display and inline math render differently; something for taco 

\startMPenvironment[global]

    \startmathcollection [default]
        \definemathsymbol [varointctrclockwise] [op] [mc] [43] [mc] [44]
    \stopmathcollection
    \usetypescript[times][ec]
    \setupbodyfont[times,11pt]

\stopMPenvironment

\starttext

why the funny .15cm scale ... 

\startformula
    \varointctrclockwise_{\gamma} f(z) \: dz = 0
\stopformula

$\varointctrclockwise_{\gamma} f(z) \: dz = 0$

\startMPcode
    draw btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex scaled 0.15cm ;
\stopMPcode

\startMPcode
    draw btex $\displaystyle \varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex scaled 0.15cm ;
\stopMPcode

\stoptext


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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 12:59 ` Hans Hagen
@ 2006-07-19 13:16   ` Taco Hoekwater
  2006-07-19 14:06     ` WN
  2006-07-19 14:01   ` WN
  1 sibling, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2006-07-19 13:16 UTC (permalink / raw)




Hans Hagen wrote:
> make sure that mp knows about the definitions: 
> 
> - first extend the math collection (use decimen, since there is a linesplit bug with " here) 
> - then load the times font 

Math family mc has to be txexa or something similar before the code
actually shows the integral instead  of a plus sign, but Wim can
figure that out himself, no doubt  :-)

> - somehow display and inline math render differently; something for taco 

That is normal. One is with an operator with \limits, one without.

Taco

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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 12:06 Metapost/Metafun/Tex/Context question WN
  2006-07-19 12:59 ` Hans Hagen
@ 2006-07-19 14:00 ` Aditya Mahajan
  2006-07-19 14:10   ` WN
  1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2006-07-19 14:00 UTC (permalink / raw)


On Wed, 19 Jul 2006, WN wrote:

> Hi all,
>
> I am trying to do the following in Metapost but my new math symbol  is
> not recognized.
> Context knows about it but Tex does not.
>
> How can I make this work ?

Hans and Taco have already explained the correct way to do this, so I 
will not go into that. This is one place where you can use the new 
sometxt feature.

> % ================= Test code ========================
> \loadmapfile[original-youngryu-tx.map]
> \definebodyfont [28pt,24pt,18pt,
>  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>  mc=txexa sa 1]
>
> \setupbodyfont [11pt]
> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>
> \starttext
> \startformula
> \varointctrclockwise_{\gamma} f(z) \: dz = 0
> \stopformula
> \startMPcode
>    picture p ;
>    path q;
>    numeric u;
>
>    u := 1cm;
>
>    p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;

Replace this by

      p := \sometxt{$\varointctrclockwise_{\gamma} f(z) \: dz = 0$} ;

and everything works!



>    p := p scaled 0.15cm;
>    draw p;
> \stopMPcode
> \stoptext
>
Aditya

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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 12:59 ` Hans Hagen
  2006-07-19 13:16   ` Taco Hoekwater
@ 2006-07-19 14:01   ` WN
  1 sibling, 0 replies; 7+ messages in thread
From: WN @ 2006-07-19 14:01 UTC (permalink / raw)


[-- Attachment #1: Type: text/html, Size: 3493 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 13:16   ` Taco Hoekwater
@ 2006-07-19 14:06     ` WN
  0 siblings, 0 replies; 7+ messages in thread
From: WN @ 2006-07-19 14:06 UTC (permalink / raw)


[-- Attachment #1: Type: text/html, Size: 4278 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Metapost/Metafun/Tex/Context question
  2006-07-19 14:00 ` Aditya Mahajan
@ 2006-07-19 14:10   ` WN
  0 siblings, 0 replies; 7+ messages in thread
From: WN @ 2006-07-19 14:10 UTC (permalink / raw)


adityam@umich.edu wrote:
> On Wed, 19 Jul 2006, WN wrote:
>
>   
>> Hi all,
>>
>> I am trying to do the following in Metapost but my new math symbol  is
>> not recognized.
>> Context knows about it but Tex does not.
>>
>> How can I make this work ?
>>     
>
> Hans and Taco have already explained the correct way to do this, so I 
> will not go into that. This is one place where you can use the new 
> sometxt feature.
>
>   
>> % ================= Test code ========================
>> \loadmapfile[original-youngryu-tx.map]
>> \definebodyfont [28pt,24pt,18pt,
>>  17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] [mm] [
>>  mc=txexa sa 1]
>>
>> \setupbodyfont [11pt]
>> \definemathsymbol [varointctrclockwise] [op] [mc] ["2B] [mc] ["2C]
>>
>> \starttext
>> \startformula
>> \varointctrclockwise_{\gamma} f(z) \: dz = 0
>> \stopformula
>> \startMPcode
>>    picture p ;
>>    path q;
>>    numeric u;
>>
>>    u := 1cm;
>>
>>    p := btex $\varointctrclockwise_{\gamma} f(z) \: dz = 0$ etex;
>>     
>
> Replace this by
>
>       p := \sometxt{$\varointctrclockwise_{\gamma} f(z) \: dz = 0$} ;
>
> and everything works!
>
>   
I was wondering about the \sometxt feature, I did not know exactly how 
to use it, but will certainly do
some experiments. Thanks Wim.


>
>   
>>    p := p scaled 0.15cm;
>>    draw p;
>> \stopMPcode
>> \stoptext
>>
>>     
> Aditya
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   

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

end of thread, other threads:[~2006-07-19 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-19 12:06 Metapost/Metafun/Tex/Context question WN
2006-07-19 12:59 ` Hans Hagen
2006-07-19 13:16   ` Taco Hoekwater
2006-07-19 14:06     ` WN
2006-07-19 14:01   ` WN
2006-07-19 14:00 ` Aditya Mahajan
2006-07-19 14:10   ` WN

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