ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt textext fails
@ 2007-01-24 21:54 Hans van der Meer
  2007-01-25 12:48 ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Hans van der Meer @ 2007-01-24 21:54 UTC (permalink / raw)
  To: NTG ConTeXt


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

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



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

* Re: ConTeXt textext fails
  2007-01-24 21:54 ConTeXt textext fails Hans van der Meer
@ 2007-01-25 12:48 ` Mojca Miklavec
  2007-01-26 12:06   ` Hans van der Meer
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2007-01-25 12:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

* Re: ConTeXt textext fails
  2007-01-25 12:48 ` Mojca Miklavec
@ 2007-01-26 12:06   ` Hans van der Meer
  2007-01-26 14:39     ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Hans van der Meer @ 2007-01-26 12:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

* Re: ConTeXt textext fails
  2007-01-26 12:06   ` Hans van der Meer
@ 2007-01-26 14:39     ` Mojca Miklavec
  2007-01-26 17:20       ` Hans van der Meer
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2007-01-26 14:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

* Re: ConTeXt textext fails
  2007-01-26 14:39     ` Mojca Miklavec
@ 2007-01-26 17:20       ` Hans van der Meer
  0 siblings, 0 replies; 5+ messages in thread
From: Hans van der Meer @ 2007-01-26 17:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

end of thread, other threads:[~2007-01-26 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-24 21:54 ConTeXt textext fails Hans van der Meer
2007-01-25 12:48 ` Mojca Miklavec
2007-01-26 12:06   ` Hans van der Meer
2007-01-26 14:39     ` Mojca Miklavec
2007-01-26 17:20       ` Hans van der Meer

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