ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Another Metafun issue
@ 2004-05-16 10:37 Sebastian Sturm
  2004-05-16 12:21 ` Peter Münster
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Sturm @ 2004-05-16 10:37 UTC (permalink / raw)


Hi,

when trying to set fractions or non-square roots in Metapost figures 
using the Metafun macro textext (textext("\frac{a}{b}") or 
textext("\root a \of b")), I get the error message

!Undefined control sequence
$\setbox \rootbox \hbox {$\mathsurround \z
				@ \scriptscriptstyle {a }$}\m...

in case of the root and

!Missing $ inserted.
<inserted text>
		$
<to be read again>
		\mathchoice
l.11 $\relax ${{\mathchoice
			{\displaystyle a}{\textstyle a}{\scriptstyle a}{...
in case of the fraction.

I probably made some stupid error, but I can't seem to find it.

Best regards,
Sebastian

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

* Re: Another Metafun issue
  2004-05-16 10:37 Another Metafun issue Sebastian Sturm
@ 2004-05-16 12:21 ` Peter Münster
  2004-05-16 16:26   ` Sebastian Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Münster @ 2004-05-16 12:21 UTC (permalink / raw)


On Sun, 16 May 2004, Sebastian Sturm wrote:

> when trying to set fractions or non-square roots in Metapost figures 
> using the Metafun macro textext (textext("\frac{a}{b}") or 
> textext("\root a \of b")), I get the error message
> 
> !Missing $ inserted.

Hello Sebastian,
I don't know much about Metafun yet, but shouldn't you use math-mode for
\root and \frac?
Cheers, Peter

-- 
http://pmrb.free.fr/contact/
________________________________________________________________
FilmSearch engine with a lot of new features: http://f-s.sf.net/

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

* Re: Another Metafun issue
  2004-05-16 12:21 ` Peter Münster
@ 2004-05-16 16:26   ` Sebastian Sturm
  2004-05-16 16:37     ` Patrick Gundlach
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Sturm @ 2004-05-16 16:26 UTC (permalink / raw)


Hi,

> Hello Sebastian,
> I don't know much about Metafun yet, but shouldn't you use math-mode 
> for
> \root and \frac?

oops, stupid typo. The code that didn't want to compile was 
textext("$\root a \of b$") and textext("$\frac{a}{b}$"), so I only 
forgot the math signs when writing the email. Thanks for pointing that 
out.

Best regards,
Sebastian

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

* Re: Another Metafun issue
  2004-05-16 16:26   ` Sebastian Sturm
@ 2004-05-16 16:37     ` Patrick Gundlach
  2004-05-16 17:46       ` Sebastian Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Gundlach @ 2004-05-16 16:37 UTC (permalink / raw)


Hello Sebastian,


> oops, stupid typo. The code that didn't want to compile was
> textext("$\root a \of b$") and textext("$\frac{a}{b}$"), so I only
> forgot the math signs when writing the email. 

Well, you should post a *complete* and *minimal* examplefile showing
your problem, together with the context/metafun version numbers (or
logfile). This way emails like the last one can be avoided and the
others can try to reproduce the problem without hassle.

Patrick

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

* Re: Re: Another Metafun issue
  2004-05-16 16:37     ` Patrick Gundlach
@ 2004-05-16 17:46       ` Sebastian Sturm
  2004-05-16 18:18         ` Patrick Gundlach
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Sturm @ 2004-05-16 17:46 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

Hi,

> Well, you should post a *complete* and *minimal* examplefile showing
> your problem, together with the context/metafun version numbers (or
> logfile). This way emails like the last one can be avoided and the
> others can try to reproduce the problem without hassle.

okay, sorry for that. I've included a simple test file and the 
corresponding *.log files. The error message can be found in the 
tmpgraph.log file. I'm using the i-Installer teTeX distribution with 
the main TeX package dating from 2004/05/05.

Best regards,
Sebastian



[-- Attachment #2: testfile.tex --]
[-- Type: application/x-tex, Size: 193 bytes --]

[-- Attachment #3: testfile-mpgraph.log --]
[-- Type: application/octet-stream, Size: 353 bytes --]

This is MetaPost, Version 0.641 (Web2C 7.5.2) (mem=metafun 2004.5.14)  16 MAY 2004 19:11
(/usr/local/teTeX/share/texmf.tetex/web2c/cp8bit.tcx)
**&metafun testfile-mpgraph
(testfile-mpgraph.mp
{randomseed:=2119}
write0 = `testfile-mpgraph.mpo'.

write0 = `testfile-mpgraph.mpt'.

 [1]
metafun 2004-5-14 22:12
 )
1 output file written: testfile-mpgraph.1

[-- Attachment #4: testfile.log --]
[-- Type: application/octet-stream, Size: 3167 bytes --]

This is pdfeTeXk, Version 3.141592-1.11b-2.1 (Web2C 7.5.2) (format=cont-en 2004.5.14)  16 MAY 2004 19:11
entering extended mode
 %&-line parsing enabled.
 (/usr/local/teTeX/share/texmf.tetex/web2c/cp8bit.tcx)
**&cont-en testfile.tex
(./testfile.tex{/usr/local/teTeX/share/texmf.local/pdftex/config/pdftex.cfg}

ConTeXt  ver: 2004.1.13  fmt: 2004.5.14  int: english  mes: english

language       : language en is active
<protectionstate 0>
system         : cont-new loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-new.tex
systems        : beware: some patches loaded from cont-new.tex!
system (E-TEX) : [line 99] 
system (E-TEX) : [line 105] \lastnodetype 
system (E-TEX) : [line 151] 
system (E-TEX) : [line 237] \lastnodetype 
)
system         : cont-old loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-old.tex
loading        : Context Old Macros
)
system         : cont-fil loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
bodyfont       : 12pt rm is loaded
language       : patterns 2:2-en-2 3:2-uk-2 4:2-de-2 5:2-fr-2 6:2-es-2 7:2-it-2
 8:2-nl-2 loaded
specials       : tex,postscript,rokicki loaded
\openout2 = `testfile.tui'.

system         : testfile.top loaded
(./testfile.top
specials       : loading definition file tpd
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-tpd.tex
specials       : loading definition file fdf
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-fdf.tex
<unprotect 3> <unprotect 4>
system (E-TEX) : [line 1907] \ifcsname 
<protect 4> <protect 3>)
specials       : fdf loaded
<unprotect 3> <protect 3>)
specials       : fdf,tpd loaded
)
\openout0 = `mpgraph.mp'.

\openout0 = `mprun.mp'.

\openout0 = `mpgraph.mp'.

\openout0 = `mprun.mp'.


pdftex         : needs map file: original-context-symbol.map
pdftex         : needs map file: pl0-ams-cmr.map
pdftex         : needs map file: original-vogel-symbol.map
systems        : begin file testfile at line 8
\openout5 = `testfile-mpgraph.mp'.

systems        : randomizer starts with 1348917701
[MP to PDF] (./testfile-mpgraph.1)
floatblocks    : 1 placed
[1.1{/usr/local/teTeX/share/texmf.local/fonts/map/pdftex/updmap/pdftex.map}]
systems        : end file testfile at line 10
[flush and process testfile-mpgraph.mp afterwards] ) 
Here is how much of TeX's memory you used:
 829 strings out of 66961
 12728 string characters out of 725323
 4429132 words of memory out of 5528306
 31684 multiletter control sequences out of 10000+50000
 10584 words of font info for 35 fonts, out of 1000000 for 2000
 62 hyphenation exceptions out of 1000
 44i,16n,50p,190b,272s stack positions out of 5000i,500n,6000p,200000b,40000s
 13 PDF objects out of 300000
 0 named destinations out of 131072
 1 words of extra memory for PDF output out of 65536
{/usr/local/teTeX/share/tex
mf.tetex/dvips/tetex/f7b6d320.enc}</usr/local/teTeX/share/texmf.tetex/fonts/typ
e1/bluesky/cm/cmbx12.pfb></usr/local/teTeX/share/texmf.tetex/fonts/type1/bluesk
y/cm/cmr10.pfb></usr/local/teTeX/share/texmf.tetex/fonts/type1/bluesky/cm/cmr12
.pfb>
Output written on testfile.pdf (1 page, 12059 bytes).

[-- Attachment #5: tmpgraph.log --]
[-- Type: application/octet-stream, Size: 3017 bytes --]

This is pdfeTeXk, Version 3.141592-1.11b-2.1 (Web2C 7.5.2) (format=cont-en 2004.5.14)  16 MAY 2004 19:11
entering extended mode
 %&-line parsing enabled.
 (/usr/local/teTeX/share/texmf.tetex/web2c/cp8bit.tcx)
**&cont-en tmpgraph.tex
(./tmpgraph.tex{/usr/local/teTeX/share/texmf.local/pdftex/config/pdftex.cfg}

ConTeXt  ver: 2004.1.13  fmt: 2004.5.14  int: english  mes: english

language       : language en is active
<protectionstate 0>
system         : cont-new loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-new.tex
systems        : beware: some patches loaded from cont-new.tex!
system (E-TEX) : [line 99] 
system (E-TEX) : [line 105] \lastnodetype 
system (E-TEX) : [line 151] 
system (E-TEX) : [line 237] \lastnodetype 
)
system         : cont-old loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-old.tex
loading        : Context Old Macros
)
system         : cont-fil loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
bodyfont       : 12pt rm is loaded
language       : patterns 2:2-en-2 3:2-uk-2 4:2-de-2 5:2-fr-2 6:2-es-2 7:2-it-2
 8:2-nl-2 loaded
specials       : tex,postscript,rokicki loaded
\openout2 = `tmpgraph.tui'.

system         : tmpgraph.top loaded
(./tmpgraph.top
specials       : loading definition file dvi
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-dvi.tex
<unprotect 3> <protect 3>)
specials       : tex loaded
specials       : loading definition file ps
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-ps.tex)
specials       : tex,postscript loaded
specials       : loading definition file tr
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-tr.tex)
specials       : tex,postscript,rokicki loaded
)
\openout0 = `mpgraph.mp'.

\openout0 = `mprun.mp'.

\openout0 = `mpgraph.mp'.

\openout0 = `mprun.mp'.


pdftex         : needs map file: original-context-symbol.map
pdftex         : needs map file: pl0-ams-cmr.map
pdftex         : needs map file: original-vogel-symbol.map
! Missing $ inserted.
<inserted text> 
                $
<to be read again> 
                   \mathchoice 
l.3 $\relax ${{\mathchoice
                           {\displaystyle a}{\textstyle a}{\scriptstyle a}{\...

? 
! Emergency stop.
<inserted text> 
                $
<to be read again> 
                   \mathchoice 
l.3 $\relax ${{\mathchoice
                           {\displaystyle a}{\textstyle a}{\scriptstyle a}{\...
End of file on the terminal!

 
Here is how much of TeX's memory you used:
 293 strings out of 66961
 4619 string characters out of 725323
 4404186 words of memory out of 5503360
 31158 multiletter control sequences out of 10000+50000
 10284 words of font info for 34 fonts, out of 1000000 for 2000
 62 hyphenation exceptions out of 1000
 24i,4n,18p,228b,53s stack positions out of 5000i,500n,6000p,200000b,40000s
 0 PDF objects out of 300000
 0 named destinations out of 131072
 1 words of extra memory for PDF output out of 65536
No pages of output.

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

* Re: Another Metafun issue
  2004-05-16 17:46       ` Sebastian Sturm
@ 2004-05-16 18:18         ` Patrick Gundlach
  2004-05-16 19:14           ` Sebastian Sturm
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Gundlach @ 2004-05-16 18:18 UTC (permalink / raw)


Hello Sebastian (sorry for sending twice; this time to the list),

> \startuseMPgraphic{test}
> draw textext("$\frac{a}{b}$");
> draw textext("$\root a \of b$");
> \stopuseMPgraphic


any reason you use textext here? Do you need changing labels? If not,
you should use

--------------------------------------------------
\startuseMPgraphic{test}
draw btex $\frac{a}{b}$ etex;
draw btex $\root a \of b$ etex shifted (10,10)
\stopuseMPgraphic

\useMPgraphic{test}
--------------------------------------------------

as a workaround. But this still looks like an unwanted behaviour to
me.

Patrick

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

* Re: Re: Another Metafun issue
  2004-05-16 18:18         ` Patrick Gundlach
@ 2004-05-16 19:14           ` Sebastian Sturm
  2004-05-16 19:36             ` Patrick Gundlach
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Sturm @ 2004-05-16 19:14 UTC (permalink / raw)


Hi,

> any reason you use textext here? Do you need changing labels? If not,
> you should use [...] draw btex $\frac{a}{b}$ etex; [...]

I thought textext was just a faster version of btex ... etex and 
supposed that this would be the 'way to go', since it is a part of 
MetaFun. But I checked out the btex ... etex version and that worked 
out like a charm. As you can tell from my previous posts, I'm a TeX 
newbie, so I don't know what's wrong here (if at all), but since it's 
working now and there is no noticeable speed difference, I'm happy with 
it.
So, thanks for your help and best regards,

Sebastian

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

* Re: Another Metafun issue
  2004-05-16 19:14           ` Sebastian Sturm
@ 2004-05-16 19:36             ` Patrick Gundlach
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick Gundlach @ 2004-05-16 19:36 UTC (permalink / raw)


Hello again,

> I thought textext was just a faster version of btex ... etex and
> supposed that this would be the 'way to go', since it is a part of
> MetaFun. 

I guess you know now; but for the record:

btex....etex does not allow any variable part in the text to be
typeset. This is due to the fact that metapost scans for btex ... etex
parts in the input file and creates the text in one single TeX run
(preprocessing) and then executes the macros (so the texts are fixed).

There are several approaches to allow texts with variable data such
as 

%% does not work!
for i=0 upto 10:
    btex "i is now " + decimal i etex;
endfor;

one of them is textext:

for i=0 upto 10:
    textext ("i is now " + decimal i);
endfor;

should work (untested)

Patrick

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

end of thread, other threads:[~2004-05-16 19:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-16 10:37 Another Metafun issue Sebastian Sturm
2004-05-16 12:21 ` Peter Münster
2004-05-16 16:26   ` Sebastian Sturm
2004-05-16 16:37     ` Patrick Gundlach
2004-05-16 17:46       ` Sebastian Sturm
2004-05-16 18:18         ` Patrick Gundlach
2004-05-16 19:14           ` Sebastian Sturm
2004-05-16 19:36             ` Patrick Gundlach

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