On 14-5-2010 12:06, Marco wrote:
iii) Why should I better use \sometxt?
sometxt was introduced in mkii to avoid text processing mp, i.e. it is done at the context end in the current run and mp only gets dimensions; so, it avoids the nested tex run in mkii there is some more trickery and much showed up whem for in instance Mojca wanted gnuplot to spit out mp
What do you mean by »more reliable«? After having read your MyWay I would say that textext is more reliable because it can do dynamic text.
in mkiv textext is implemented differently; because we use mplib, processing time is less an issue anyway
I created a testfile to compare textext and \sometxt. The points to compare were those you mentionend in your MyWay as advantages of \sometxt. The testfile »t.tex« is attached. I processed it with
in mkiv there should be no big difference as it all boils down to the same (sometxt has a command applied which textext doesn't)
ConTeXt ver: 2010.05.08 luatex, version beta-0.60.1-2010042821
Here are my results:
-There is one obvious reason: speed
$ for i in `seq 5`; do context -mode=textext t | tail -1; done MTXrun | total runtime: 128.008 MTXrun | total runtime: 37.893 MTXrun | total runtime: 37.900 MTXrun | total runtime: 38.391 MTXrun | total runtime: 38.029 $ rm t.{log,pdf,tuc} $ for i in `seq 5`; do context -mode=sometxt t | tail -1; done MTXrun | total runtime: 127.195 MTXrun | total runtime: 40.131 MTXrun | total runtime: 41.071 MTXrun | total runtime: 37.424 MTXrun | total runtime: 39.121
Average runtime: textext variant: 56s \sometxt variant: 57s
That is the same. Maybe my test file is not appropriate to test the speed. I'm sure you have performed more advanced tests.
you use mkiv
-Document-wide definitions are seen [...] definitions with arguments will fail to work.
The first line, a document-wide definition with arguments works in both versions.
-Problems with expansion [...] as far as I remember math expressions (fractions perhaps) never worked as they were supposed to
The second definition is a math expressions with fractions. It seems to work.
th emkii variant has some more limitations than the mkiv version
-Less characters to escape
Yes, that's the topic of this thread. I don't know, I didn't check. The only check I performed was the ampersand and it needs the same workaround using \letterbackslash as textext.
I know, your MyWay is old. Maybe some things are fixed now. But I don't see many advantages for me using it.
don't expect mkii and mkiv to be 100% compatible in this area (mkii is somewhat stretching things to the limit) 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 -----------------------------------------------------------------