ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)
       [not found] <mailman.1424.1275676267.4277.ntg-context@ntg.nl>
@ 2010-06-05  2:56 ` Adam Fuller
  2010-06-05 11:12   ` Hongwen Qiu
  2010-06-05 17:30 ` Wrong spacing before and after commas in math(?) Warrence
  1 sibling, 1 reply; 5+ messages in thread
From: Adam Fuller @ 2010-06-05  2:56 UTC (permalink / raw)
  To: ntg-context

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



On 5/06/2010 6:31 a.m., ntg-context-request@ntg.nl wrote:
>     3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)

hi hongwen,
thanks for taking an interest.

my initial post had a mistake:  i meant to refer to the /Metafun/ manual, not the Metapost manual.  that probably didn't help.

i guess what i should have said is, i know that pxy can give me the bounding /box/ (the rectangle with the maximum horizontal and vertical extents of its contents, be they set in horizontal or vertical mode), but can it give me the subset of that, the bounding /path/, if you will, when the contents are text which flows over several lines.  the bounding /path/ may not be rectangular, although it will be something like the union of the bounding boxes of the text's individual lines.

i think if you look at the correct reference, the difference of the effects is clear.  i think the challenge is that you don't know where the line breaks will occur until you typeset it.   --adam

[-- Attachment #2: adam_fuller.vcf --]
[-- Type: text/x-vcard, Size: 446 bytes --]

begin:vcard
fn:Adam Fuller
n:Fuller;Adam
org:University of Canterbury;Mechanical Engineering
adr:Private Bag 4800;;Intersection of Creyke Rd and Engineering Rd;Christchurch;Canterbury;8041;New Zealand
email;internet:adam.fuller@pg.canterbury.ac.nz
title:Ph.D. candidate
tel;work:(+64) 3 364 2987 ext. 8390
tel;fax:(+64) 3 364 2078
tel;home:(+64) 3 366 3455
tel;cell:(+64) 21 0254 8677
url:http://www.mech.canterbury.ac.nz/
version:2.1
end:vcard


[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)
  2010-06-05  2:56 ` 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu) Adam Fuller
@ 2010-06-05 11:12   ` Hongwen Qiu
  0 siblings, 0 replies; 5+ messages in thread
From: Hongwen Qiu @ 2010-06-05 11:12 UTC (permalink / raw)
  To: ntg-context


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

? 2010?06?05? 10:56, Adam Fuller ??:
> my initial post had a mistake:  i meant to refer to the /Metafun/ 
> manual, not the Metapost manual.  that probably didn't help.
Actually, I know that you mean the /Metafun/ manual.
> i guess what i should have said is, i know that pxy can give me the 
> bounding /box/ (the rectangle with the maximum horizontal and vertical 
> extents of its contents, be they set in horizontal or vertical mode), 
> but can it give me the subset of that, the bounding /path/, if you 
> will, when the contents are text which flows over several lines.  the 
> bounding /path/ may not be rectangular, although it will be something 
> like the union of the bounding boxes of the text's individual lines.
So now, I understand what mean.
> i think if you look at the correct reference, the difference of the 
> effects is clear.  i think the challenge is that you don't know where 
> the line breaks will occur until you typeset it.   --adam 
And the source code from the manual may help you:

\setupMPvariables[mpos:box][linecolor=darkred]
\setupMPvariables[mpos:par][linecolor=darkred]

\startpositionoverlay{backgraphics}
   \setMPpositiongraphic{A-3}{mpos:box}{self=A-3}
   \setMPpositiongraphic{A-4}{mpos:box}{self=A-4}
   \setMPpositiongraphic{b:A-5}{mpos:par}{self=A-5}
   \setMPpositiongraphic{b:A-6}{mpos:par}{self=A-6}
\stoppositionoverlay

\fpos {A-5} Because the text must be laid on top of
the graphic, the graphic must precede the first word in the
typeset stream or it must be positioned on a separate layer.
In the latter case it can be calculated directly after the
paragraph is typeset, but in the former case a second pass
is needed. \tpos {A-5}

Given the above code, I think you can get some information about the 
horizontal and vertical pos of texts from \fpos and \tpos. And the 
mpos:par is defined in anch-pgr.mkii and anch-pgr.mkiv. But I haven't 
dig into the code which implement mpos:par. Hope you can find useful 
information there.

And hope the following message I just searched out will help you too:

http://archive.contextgarden.net/message/20080107.024554.314d9fee.ca.html

[-- Attachment #1.2: Type: text/html, Size: 3297 bytes --]

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Wrong spacing before and after commas in math(?)
       [not found] <mailman.1424.1275676267.4277.ntg-context@ntg.nl>
  2010-06-05  2:56 ` 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu) Adam Fuller
@ 2010-06-05 17:30 ` Warrence
  1 sibling, 0 replies; 5+ messages in thread
From: Warrence @ 2010-06-05 17:30 UTC (permalink / raw)
  To: ntg-context

On Fri, 4 Jun 2010, "Aditya Mahajan" wrote:
 > Does
 >
 > \setupmathematics[autopunctuation=no] % or yes
 >
 > give better result? (Are you using MKIV or MKII)?
 >
 > Aditya

\setupmathematics[autopunctuation=no] seems to fix the spaces before the 
x, but "...," is still bit ugly. I'm using MkIV, sorry for not 
mentioning it.


 > the default setup is for coordinates
 >
 > eventually we will have layer that implements settings for specific
 > fields as each demand their own rules (same for symbols)
 >
 > Hans

Do you mean coordinates like "a vector (x,y,z)"? I still think that the 
extra space before "y" and "z" would be appreciated. But nevertheless, 
different settings for different needs sounds like a good idea.

Thank you,
Stefan.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu)
  2010-06-06 14:23 ` 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu) Adam Fuller
@ 2010-06-06 14:25   ` Taco Hoekwater
  0 siblings, 0 replies; 5+ messages in thread
From: Taco Hoekwater @ 2010-06-06 14:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Adam Fuller wrote:
> hmm, that's interesting.  the source of the metafun manual is a logical 
> place to look... hadn't thought of that, but where can i find it?  

http://context.aanhet.net/svn/manuals/metafun/

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu)
       [not found] <mailman.1444.1275741285.4277.ntg-context@ntg.nl>
@ 2010-06-06 14:23 ` Adam Fuller
  2010-06-06 14:25   ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Fuller @ 2010-06-06 14:23 UTC (permalink / raw)
  To: ntg-context

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

hmm, that's interesting.  the source of the metafun manual is a logical place to look... hadn't thought of that, but where can i find it?  i searched the source browser for metafun and metafun.tex to no avail.  the challenge of learning a new system like context is like cooking out of someone else's kitchen: everything you need is probably there somewhere, it's just a matter of knowing where to look.

yes, i'd like to know how this family of macros---\fpos, \tpos, mpos:box and mpos:par and friends, etc.---work, and what information you can get from them.  the only mention of these on this mailing list seems to be that bunch of messages you forwarded, which was back in 2008.  if i can get a bit of a kickstart toward figuring them out, i'd be compelled to put the basics in the wiki.

assuming mpos:box and mpos:par were some sort of built-in MPgraphics, i compiled the following short context document, where mpos:box and mpos:par had no effect :(

\setupMPvariables[mpos:box][linecolor=darkred]
\setupMPvariables[mpos:par][linecolor=darkred]

\startpositionoverlay{testing_paragraph_outline}
	\setMPpositiongraphic{pos1}{mpos:box}{self=pos1}
	\setMPpositiongraphic{pos1}{mpos:par}{self=pos1}
\stoppositionoverlay

\defineoverlay[mylayer][\positionoverlay{testing_paragraph_outline}]
\setupbackgrounds[page][background=mylayer]

\starttext
\fpos{pos1}Something special.\tpos{pos1}
\stoptext


On 6/06/2010 12:34 a.m., ntg-context-request@ntg.nl wrote:
> Date: Sat, 05 Jun 2010 19:12:28 +0800
> From: Hongwen Qiu<qiuhongwen@gmail.com>
> To:ntg-context@ntg.nl
> Subject: Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh
> 	my! (Hongwen Qiu)
> Message-ID:<4C0A311C.6010808@gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> ? 2010?06?05? 10:56, Adam Fuller ??:
>> >  my initial post had a mistake:  i meant to refer to the/Metafun/
>> >  manual, not the Metapost manual.  that probably didn't help.
> Actually, I know that you mean the/Metafun/  manual.
>> >  i guess what i should have said is, i know that pxy can give me the
>> >  bounding/box/  (the rectangle with the maximum horizontal and vertical
>> >  extents of its contents, be they set in horizontal or vertical mode),
>> >  but can it give me the subset of that, the bounding/path/, if you
>> >  will, when the contents are text which flows over several lines.  the
>> >  bounding/path/  may not be rectangular, although it will be something
>> >  like the union of the bounding boxes of the text's individual lines.
> So now, I understand what mean.
>> >  i think if you look at the correct reference, the difference of the
>> >  effects is clear.  i think the challenge is that you don't know where
>> >  the line breaks will occur until you typeset it.   --adam
> And the source code from the manual may help you:
>
> \setupMPvariables[mpos:box][linecolor=darkred]
> \setupMPvariables[mpos:par][linecolor=darkred]
>
> \startpositionoverlay{backgraphics}
>     \setMPpositiongraphic{A-3}{mpos:box}{self=A-3}
>     \setMPpositiongraphic{A-4}{mpos:box}{self=A-4}
>     \setMPpositiongraphic{b:A-5}{mpos:par}{self=A-5}
>     \setMPpositiongraphic{b:A-6}{mpos:par}{self=A-6}
> \stoppositionoverlay
>
> \fpos {A-5} Because the text must be laid on top of
> the graphic, the graphic must precede the first word in the
> typeset stream or it must be positioned on a separate layer.
> In the latter case it can be calculated directly after the
> paragraph is typeset, but in the former case a second pass
> is needed. \tpos {A-5}
>
> Given the above code, I think you can get some information about the
> horizontal and vertical pos of texts from \fpos and \tpos. And the
> mpos:par is defined in anch-pgr.mkii and anch-pgr.mkiv. But I haven't
> dig into the code which implement mpos:par. Hope you can find useful
> information there.
>
> And hope the following message I just searched out will help you too:
>
> http://archive.contextgarden.net/message/20080107.024554.314d9fee.ca.html
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:<http://www.ntg.nl/pipermail/ntg-context/attachments/20100605/66da92a8/attachment-0001.html>
>

[-- Attachment #2: adam_fuller.vcf --]
[-- Type: text/x-vcard, Size: 446 bytes --]

begin:vcard
fn:Adam Fuller
n:Fuller;Adam
org:University of Canterbury;Mechanical Engineering
adr:Private Bag 4800;;Intersection of Creyke Rd and Engineering Rd;Christchurch;Canterbury;8041;New Zealand
email;internet:adam.fuller@pg.canterbury.ac.nz
title:Ph.D. candidate
tel;work:(+64) 3 364 2987 ext. 8390
tel;fax:(+64) 3 364 2078
tel;home:(+64) 3 366 3455
tel;cell:(+64) 21 0254 8677
url:http://www.mech.canterbury.ac.nz/
version:2.1
end:vcard


[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2010-06-06 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1424.1275676267.4277.ntg-context@ntg.nl>
2010-06-05  2:56 ` 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu) Adam Fuller
2010-06-05 11:12   ` Hongwen Qiu
2010-06-05 17:30 ` Wrong spacing before and after commas in math(?) Warrence
     [not found] <mailman.1444.1275741285.4277.ntg-context@ntg.nl>
2010-06-06 14:23 ` 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu) Adam Fuller
2010-06-06 14:25   ` Taco Hoekwater

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