![](https://secure.gravatar.com/avatar/58128ef2fa853eca7f2503a152c340ae.jpg?s=120&d=mm&r=g)
I did the update to ConTeXt 2006-01-18 but almost regret that decision as an old problem seems to surface again. Typesetting a file that has not failed me with an august2006 version now crashes. Relevant data from the processing log (using TeXShop): systems : begin file syllabus-s-mpgraph-temp at line 42 .... ! Undefined control sequence. l.53 \tts 66\%\CCC :4:126% So what is going on here? File syllabus-s-mpgraph-temp shows at the offending site: \starttext ..... \startMPXpage \tts 66\%\CCC:4:126% \stopMPXpage And this code must have been come from a metapost source: \startuseMPgraphic{taalengels}{width,height,gap} .... label.ulft(textext("\tts 66\%~"), (bs + 27 * u, baseline + 660 * bt + dotsize/2)); Aha, I conclude, trouble with the %-sign! But I think I have seen that error before, originating in one of the Ruby-scripts if I remember well. Having to do with the file parsing and failing on %'s or something like that. Hans Hagen had it fixed then with a patch on a ruby script. Why is this problem now cropping up again? Can this be fixed? Thanks in advance for the trouble this causes. Hans van der Meer
![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On 1/24/07, Hans van der Meer wrote:
I did the update to ConTeXt 2006-01-18 but almost regret that decision as an old problem seems to surface again. Typesetting a file that has not failed me with an august2006 version now crashes.
...
\startuseMPgraphic{taalengels}{width,height,gap} .... label.ulft(textext("\tts 66\%~"), (bs + 27 * u, baseline + 660 * bt + dotsize/2));
I don't know how to solve the problem you describe, but you can circumvent it by replacing textext("\tts 66\%~") by \sometxt{\tts 66\%~} It will also run much faster and more efficient. Mojca
![](https://secure.gravatar.com/avatar/58128ef2fa853eca7f2503a152c340ae.jpg?s=120&d=mm&r=g)
On Jan 25, 2007, at 13:48, Mojca Miklavec wrote:
On 1/24/07, Hans van der Meer wrote:
I did the update to ConTeXt 2006-01-18 but almost regret that decision as an old problem seems to surface again. Typesetting a file that has not failed me with an august2006 version now crashes.
...
\startuseMPgraphic{taalengels}{width,height,gap} .... label.ulft(textext("\tts 66\%~"), (bs + 27 * u, baseline + 660 * bt + dotsize/2));
I don't know how to solve the problem you describe, but you can circumvent it by replacing textext("\tts 66\%~") by \sometxt{\tts 66\%~} It will also run much faster and more efficient.
Mojca
Thanks. This helps, allthough I need to use \textext instead of \sometxt. The reason being that the picture returned in \textext is processed further by the homemade Labelmacro for placement which I use for global color settings of various elements of the drawing. My confusion was with MetaFun's textext macro and TeX's \textext (and \sometext) macro. met vriendelijke groet Hans van der Meer
![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On 1/26/07, Hans van der Meer wrote:
On Jan 25, 2007, at 13:48, Mojca Miklavec wrote:
On 1/24/07, Hans van der Meer wrote:
I did the update to ConTeXt 2006-01-18 but almost regret that decision as an old problem seems to surface again. Typesetting a file that has not failed me with an august2006 version now crashes.
...
\startuseMPgraphic{taalengels}{width,height,gap} .... label.ulft(textext("\tts 66\%~"), (bs + 27 * u, baseline + 660 * bt + dotsize/2));
I don't know how to solve the problem you describe, but you can circumvent it by replacing textext("\tts 66\%~") by \sometxt{\tts 66\%~} It will also run much faster and more efficient.
Mojca
Thanks. This helps, allthough I need to use \textext instead of \sometxt. The reason being that the picture returned in \textext is processed further by the homemade Labelmacro for placement which I use for global color settings of various elements of the drawing. My confusion was with MetaFun's textext macro and TeX's \textext (and \sometext) macro.
But then I have a question for you: can you please explain in more details what \textext can do that \sometxt can't? (I didn't really understand your description.) I didn't understand your problem, but does it make any difference if you set \chardef\TeXtextcolormode\zerocount at the top of your document? (In the case that you have problems with colors.) Mojca
![](https://secure.gravatar.com/avatar/58128ef2fa853eca7f2503a152c340ae.jpg?s=120&d=mm&r=g)
On Jan 26, 2007, at 15:39, Mojca Miklavec wrote:
On 1/26/07, Hans van der Meer wrote:
On Jan 25, 2007, at 13:48, Mojca Miklavec wrote:
I don't know how to solve the problem you describe, but you can circumvent it by replacing textext("\tts 66\%~") by \sometxt{\tts 66\%~} It will also run much faster and more efficient.
Mojca
Thanks. This helps, allthough I need to use \textext instead of \sometxt. The reason being that the picture returned in \textext is processed further by the homemade Labelmacro for placement which I use for global color settings of various elements of the drawing. My confusion was with MetaFun's textext macro and TeX's \textext (and \sometext) macro.
But then I have a question for you: can you please explain in more details what \textext can do that \sometxt can't? (I didn't really understand your description.)
I didn't understand your problem, but does it make any difference if you set \chardef\TeXtextcolormode\zerocount at the top of your document? (In the case that you have problems with colors.)
Let me explain why I have still need for \textext and textext. I think there is room for all of these: textext, \textext, \sometxt. For the use of \textext see my Label-macro in MetaPost below:
% =========================== Labels =========================== % Produce labels, shifted to their intended places. % Text at specific point possibly rotated, shifted, scaled, colored. % In contrast to plain.mf we do not solely use fixed (3bp) labeloffset, % but add half the width and/or height of the current pen. % labeltext = Lab.xx(string) [scaled,shifted] or picture % pos = point where to place text
% Label(string/textext(string)) vardef Lab@#(expr labeltext) = theLabel@#(labeltext, origin) enddef;
% Label(string/textext(string), center) (label = synonym) def Label = draw theLabel enddef;
% Label with text and centerposition vardef theLabel@#(expr labeltext, pos) = save pic; picture pic; if picture labeltext: pic := labeltext; else: if labeltext = "": pic := nullpicture; else: % prevent wobbling of text boxes with uneven depth pic := textext("\setbox0=\hbox{"&labeltext&"}\dp0=0pt\box0"); fi fi
% calculate labelshift from suffix save shift; pair shift; shift = ((penX/2 + labeloffset) * xpart laboff@#, (penY/2 + labeloffset) * ypart laboff@#) - (labxf@# * lrcorner pic + labyf@# * ulcorner pic + (1 - labxf@# - labyf@#) * llcorner pic);
% deliver picture shifted in position pic shifted (pos + shift) enddef; % =========================== end of Labels ===========================
Using Label("a string", position) is mostly used. It allows one for example to concatenate strings in the MetaPost code, insert the value of numeric MetaPost variables within the string, etc. However when textext fails (notably the use of \%, but I have seen others) I use \textext. The crux here is the fact that it returns a MetaPost picture; the code tests for this type on the labeltext parameter. At first I tried \sometxt but that didn't work. I didn't pursue the causes much further, but I suspect that it does not return a picture. I will look into your new MyWay on \sometxt over the weekend. Hans van der Meer
participants (2)
-
Hans van der Meer
-
Mojca Miklavec