[NTG-context] help
attachment: adam_fuller.vcf___ 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 ___
Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu)
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-requ...@ntg.nl wrote: Date: Sat, 05 Jun 2010 19:12:28 +0800 From: Hongwen Qiuqiuhong...@gmail.com To:ntg-context@ntg.nl Subject: Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu) Message-ID:4c0a311c.6010...@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: adam_fuller.vcf___ 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 ___
[NTG-context] \MPpos, pxy, initialize_box(), oh my!
hello all, i finished a presentation (my first ConTeXt creation!), and now i've got a couple days to get creative again. i'm trying to understand how the typeset lines of text in the MetaPost manual were outlined in Section 5.1. i've just discovered that \MPpos only seems to work in MPpositiongraphics, and initialize_box sets `pxy' to \hpos's contents bounding box. what if you want pxy to be not strictly a rectangle, but the path that encloses text, etc., which is just part of flowing text in a paragraph, like page 247 (beginning of Positional Graphics chapter) in the MetaPost manual? i've read the MetaPost manual. i hope the answer isn't too obvious. thanks, adam attachment: adam_fuller.vcf___ 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 ___
[NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)
On 5/06/2010 6:31 a.m., ntg-context-requ...@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: adam_fuller.vcf___ 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 ___
[NTG-context] Difference in whitespace around section head from mkII to mkIV
hi all, i'm experiencing some unwanted whitespace related to a section head. the whitespace is present when using lua (texexec --lua funk.tex) and absent when using mkII (texexec funk.tex). i've confirmed the correct mkII behaviour on the garden's live tool, and my own minimals installation: This is LuaTeX, Version beta-0.60.1-2010050621 (rev 3678) \write18 enabled. (funk.tex ConTeXt ver: 2010.05.13 12:15 MKIV fmt: 2010.5.21 int: english/english if you run the document below on mkII, you'll see that the first text on each slide is right up against the top of the text area. this is good. if you use my version of luatex, a line is skipped. why the difference? i'm not actually using anything lua (i've just started using Context in the past weeks, and i've got a conference presentation due in 3 days, so i've got weird habits. i'm just now getting my head around the copious amounts of documentation for the system, and all the differences between context, luatex, pdftex, mkII, mkIV, and all the other new terms), so i'll probably just texexec funk.tex as a workaround. /however/, when i get some free time, i'll be playing with lua, and i'd like it to work right. i've been a latex user since my undergrad a couple of years ago, and i just found metapost maybe one month ago. what an eye opener! i love programming and i love making dorky little vector images... it's the perfect marriage! maybe somebody bright can shed some light on this? thanks everybody, adam % author: adam fuller % date: 24/5/2010 % description: why does placehead=no,page=yes in \definehead push % the first line of a slide down by one? when a slide is too long % and breaks to another page, that page starts right up at the top, % without the annoying extra whitespace. trying to unravel it. \setupheadertexts[myslide][] \setupheader[state=start] \setuppagenumbering[state=stop] \definehead[myslide][subsubsection] \setuphead[myslide][style=slanted,placehead=no,page=yes] \definestartstop[slide][ before={\page\startalignment[right,nothyphenated,hanging]\tf}, after={\stopalignment}] \starttext \showframe[text]% \showframe[header]% \myslide{}% \midaligned\framed[location=middle,align=center,offset=none,frame=off]{ %\blank[2*big,force] {\bfa Adam Fuller} \blank[1*big,force] {\em from} \blank[1*big,force] {\bfa U. Canterbury} \blank[1*big,force] {\em talks about} \blank[1*big,force] {\bfa Adapting simplified propeller turbines to higher specific speeds: CFD studies} \blank[1*big,force] {\em at} \blank[1*big,force] {\bfa Hidroenergia 2010} } \page% \myslide{Where I start from}% My Ph.D. research has been to increase the specific speed ($N_S$), starting with an existing range, while maintaining a turbine efficiency of 70\%. By \em{adapting}, I mean taking an existing design \em{philosophy} to a new design \em{point}. This \em{philosophy} is just a list of rules that reflect the turbines' intended use: \startitemize \item no guide vanes \item run at 1500~rev/min only \item use flat blades \stopitemize \myslide{New design point, new challenges} The paper discusses how increasing the specific speed may impact on the design of such a turbine's three main components. The adapted version of each component brings its own challenges. At higher $N_S$ \startitemize \item draft tube performance is increasingly important. How sensitive is its performance to the inputs in this particular case? \item velocity triangles at the runner's leading and trailing edge become less forgiving to uncertainty (dimensional and fluid dynamical) \item the volute's priority changes from \quote{provide swirl $x$} to \quote{provide uniform axial flow at mimimum loss}. How must the design change? \stopitemize \myslide{For this presentation} To illuminate these three points, I worked up a CFD study related to each component. To summarize the studies: \startitemize \item Draft tube: $C_p = f({\rm swirl}, \theta)$. What is $f$? I'll try to put my result in the context of the literature. \item Runner: from the desktop-design stage, the ratios \startformula \omega r:V_a:\Delta V_t\approx 8:4:1, \stopformula are expected to cause problems with sensitivity of output and efficiency to speed. I'll talk about how my CFD results suprised me. \item Volute: Trying to reconcile the need for predictable axial runner inlet flow, low loss, and no flow-spanning vanes or struts has led to an adaptation of previous Giddens volutes. I'll talk about the changes that were made, and show that the new volute looks to meet the requirements. \stopitemize \stoptext attachment: adam_fuller.vcf___ If your question is of interest to others