Re: [NTG-context] Asymptote in Context
On Wed, 24 Dec 2014, Context NTG wrote: Could anybody explain how to use Asymptote in ConTeXt with the filter module. Can you post a minimal asymptote file and how it shoud be processed via the command line? Aditya ___ 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] Define a new type section with metafun
On 12/28/2014 12:01 AM, Akira Kakuto wrote: Dear Fabrice, A try and error method which you may not want: % macros=mkvi \setuppapersize[A4][A4] \setupcolors[state=start,cmyk=yes,mpcmyk=yes] \definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00] \definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3] \starttext \startuniqueMPgraphic{funny} path p ; numeric h ; h := OverlayHeight ; p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed 0.9 ; pickup pencircle scaled \overlaylinewidth ; fill p withcolor \MPcolor{\overlaycolor} ; draw (20,1)--(20,h-1) withcolor red ; draw p withcolor \MPcolor{\overlaylinecolor} ; \stopuniqueMPgraphic \defineoverlay[funny][\uniqueMPgraphic{funny}] \define[2]\MySectionCommand {\framed [background=funny, frame=off, width=0.5\textwidth, align={right}, framecolor=mycolor, rulethickness=1.5pt, backgroundcolor=white, offset=4pt] {\tfb #1\space\colortext#2}} \setuphead[section][command=\MySectionCommand,ownnumber=yes,numbercolor=colortext] \section{A}{PLAN DE L'ESPACE} \stoptext or reshuffle the drawing a bit and clip \startuniqueMPgraphic{funny} numeric h ; h := OverlayHeight ; pathp ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed 0.9 ; pickup pencircle scaled \overlaylinewidth ; fill p withcolor \MPcolor{\overlaycolor} ; draw (20,-1)--(20,h+1) withcolor red ; clip currentpicture to p ; draw p withcolor \MPcolor{\overlaylinecolor} ; \stopuniqueMPgraphic - 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 - ___ 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] fluctuating baseline of header text
On 12/27/2014 4:35 PM, j. van den hoff wrote: my questions: -- would that (a common baseline for the text in all the page headers) be better or worse than the present behaviour from a typographical point of view? whatever variant we make, you always need to take font properties into account when you mix sizes .. there is no general solution (at least not one that would break other usage) -- if desirable, could/should it be done? -- could such behaviour be achieved presently with some clever trick? \showstruts \setuppagenumbering[style=\bfd\setcharstrut{0123456789}\strut,strut=no] - no default strut - calculate one based on to-be-used-characters (tight case) - apply that one compare it with \setuppagenumbering[style=\bfd\setstrut\strut] And then wikify it 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 - ___ 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] Define a new type section with metafun
Dear Fabrice, A try and error method which you may not want: % macros=mkvi \setuppapersize[A4][A4] \setupcolors[state=start,cmyk=yes,mpcmyk=yes] \definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00] \definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3] \starttext \startuniqueMPgraphic{funny} path p ; numeric h ; h := OverlayHeight ; p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed 0.9 ; pickup pencircle scaled \overlaylinewidth ; fill p withcolor \MPcolor{\overlaycolor} ; draw (20,1)--(20,h-1) withcolor red ; draw p withcolor \MPcolor{\overlaylinecolor} ; \stopuniqueMPgraphic \defineoverlay[funny][\uniqueMPgraphic{funny}] \define[2]\MySectionCommand {\framed [background=funny, frame=off, width=0.5\textwidth, align={right}, framecolor=mycolor, rulethickness=1.5pt, backgroundcolor=white, offset=4pt] {\tfb #1\space\colortext#2}} \setuphead[section][command=\MySectionCommand,ownnumber=yes,numbercolor=colortext] \section{A}{PLAN DE L'ESPACE} \stoptext Best, Akira ___ 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] misalignment of equation numbers
in this example: \starttext bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \placeformula \startformula K_1 \rightarrow E(f) = \frac {K_1(f)} { f}\,. \stopformula \placeformula \startformula K_1 \rightarrow \startmathcases \NC f \NC for \NC $f \ll PS$ \NC {\rm (flow limited transport)} \NR \NC PS \NC for \NC $f \gg PS$ \NC {\rm (diffusion limited transport),} \NR[+] \stopmathcases \stopformula bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \stoptext the label `(2)' of the second equation is not aligning properly with the right margin of the body text (and the previous equation label). what am I doing wrong here? joerg -- Using Opera's revolutionary email client: http://www.opera.com/mail/ ___ 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] fluctuating baseline of header text
coming back to this again, if one uses old-style numerals for the page numbering the "problem" is aggravated: \showframe\showglyphs \definefontfeature [default] [default] [onum=yes] \definefontfamily [mainface] [serif] [garamondno8] \setupbodyfont[mainface,12pt] \setupheader [style=\smallbodyfont\ss\it] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfc] \starttext \dorecurse{97}{\section{Introduction} bla \page[yes]} \stoptext now, it also is obious that the "baseline jumps" occur in the page numbers themselves (caused mainly by the large extension of the `6') so going, e.g., from page 25 to 26 the `2' jumps downward quite a bit. I understand that this is unavoidable if the positions are determined as they seemingly are (measuring from the top and separately for each page). what I at least would think to be nicer would be a situation where the baseline is determined for the _whole_ document as the minimum (lowest position on page) of all page-wise baselines (that would be determined by the digit `6' in the present example) and then using _that_ baseline for all headers and page numbers which would eliminate the jittering of header lines and page numbers. I am aware that this will not always be the desired behaviour and that there might be documents where header layout might not be identical document wide, so it might open a can of worms, but for most book-type documents I would think this to be reasonable and desirable. my questions: -- would that (a common baseline for the text in all the page headers) be better or worse than the present behaviour from a typographical point of view? -- if desirable, could/should it be done? -- could such behaviour be achieved presently with some clever trick? joerg On Sat, 27 Dec 2014 13:36:49 +0100, Hans Hagen wrote: solutions: - use a proper height for the header - package the header text in a box and set the height of that box -- Using Opera's revolutionary email client: http://www.opera.com/mail/ ___ 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] fluctuating baseline of header text
On Sat, 27 Dec 2014 15:07:31 +0100, j. van den hoff wrote: - package the header text in a box and set the height of that box and if you don't mind, would you give me a pointer/keyword/command name so that I can look up how to do this? joerg -- Using Opera's revolutionary email client: http://www.opera.com/mail/ ___ 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] fluctuating baseline of header text
On Sat, 27 Dec 2014 13:36:49 +0100, Hans Hagen wrote: On 12/27/2014 12:16 PM, j. van den hoff wrote: On Sat, 27 Dec 2014 10:40:30 +0100, Pablo Rodriguez wrote: On 12/26/2014 11:32 PM, j. van den hoff wrote: [...] in this example (and with this font) the problem is only occuring when toggling between pages 6/7 or 7/8 (at sufficient zoom it's easy to see), i.e.the header is shifted downward on page 7. in other docs with different fonts it happens across multiple pages. my guess would be it has to do with the digit heights in the different fonts and the fact that the page numbers are much larger than the heading, but that's only a guess. can someone confirm the problem? Hi Jörg, this sample shows the issue without zooming: thanks for confirming this. @devs: can this be considered "misbehaviour" (not to call it a bug ;-)) or is it somehow unavoidable? it's not a bug at all .. you just get what you ask for good to know. \showframe \showglyphs your header is too small so what you want only works if the heights of all characters are the same which is not the case here well this seems not to be the whole explanation AFAICS. it might be correct for pablo's example, but for my original example, which is equivalent to: \showframe\showglyphs \setupheader [style=\smallbodyfont\ss\it] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfc] \starttext \dorecurse{10}{\section{Introduction} bla \page[yes]} \stoptext I can't see that the header space is to small, no? or what am I missing? using `\showglyphs' (which I didn't know of: thanks), it still looks to me as if the problem is caused by the fact, that all positions are measured from the top and the header line's baseline is aligned with the baseline of the large page numbers glyph boxes (although only approximately so, as far as I can tell on my monitor...) where -- for the default font -- the glyphbox of the `7' has a larger vertical extension than the others (so that it extends a bit further down as measured from the top) which causes the baseline of the header to shift downwards accordingly. joerg solutions: - use a proper height for the header - package the header text in a box and set the height of that box \setuppapersize[A8] \setupheader [style=\itx\ss] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfd] \starttext \dorecurse{80}{\section{Introduction} bla\page[yes]} \stoptext When the glyph 7 is involved in page number, baseline is a bit lower. As you wrote, I guess this is related with the glyph metrics. yes. this seems to be supported by the fact that it happens differently (usually more frequently) with other fonts. joerg Just in case it helps, Pablo -- Using Opera's revolutionary email client: http://www.opera.com/mail/ ___ 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] fluctuating baseline of header text
On 12/27/2014 12:16 PM, j. van den hoff wrote: On Sat, 27 Dec 2014 10:40:30 +0100, Pablo Rodriguez wrote: On 12/26/2014 11:32 PM, j. van den hoff wrote: [...] in this example (and with this font) the problem is only occuring when toggling between pages 6/7 or 7/8 (at sufficient zoom it's easy to see), i.e.the header is shifted downward on page 7. in other docs with different fonts it happens across multiple pages. my guess would be it has to do with the digit heights in the different fonts and the fact that the page numbers are much larger than the heading, but that's only a guess. can someone confirm the problem? Hi Jörg, this sample shows the issue without zooming: thanks for confirming this. @devs: can this be considered "misbehaviour" (not to call it a bug ;-)) or is it somehow unavoidable? it's not a bug at all .. you just get what you ask for \showframe \showglyphs your header is too small so what you want only works if the heights of all characters are the same which is not the case here solutions: - use a proper height for the header - package the header text in a box and set the height of that box \setuppapersize[A8] \setupheader [style=\itx\ss] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfd] \starttext \dorecurse{80}{\section{Introduction} bla\page[yes]} \stoptext When the glyph 7 is involved in page number, baseline is a bit lower. As you wrote, I guess this is related with the glyph metrics. yes. this seems to be supported by the fact that it happens differently (usually more frequently) with other fonts. joerg Just in case it helps, Pablo -- - 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 - ___ 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] fluctuating baseline of header text
On Sat, 27 Dec 2014 10:40:30 +0100, Pablo Rodriguez wrote: On 12/26/2014 11:32 PM, j. van den hoff wrote: [...] in this example (and with this font) the problem is only occuring when toggling between pages 6/7 or 7/8 (at sufficient zoom it's easy to see), i.e.the header is shifted downward on page 7. in other docs with different fonts it happens across multiple pages. my guess would be it has to do with the digit heights in the different fonts and the fact that the page numbers are much larger than the heading, but that's only a guess. can someone confirm the problem? Hi Jörg, this sample shows the issue without zooming: thanks for confirming this. @devs: can this be considered "misbehaviour" (not to call it a bug ;-)) or is it somehow unavoidable? \setuppapersize[A8] \setupheader [style=\itx\ss] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfd] \starttext \dorecurse{80}{\section{Introduction} bla\page[yes]} \stoptext When the glyph 7 is involved in page number, baseline is a bit lower. As you wrote, I guess this is related with the glyph metrics. yes. this seems to be supported by the fact that it happens differently (usually more frequently) with other fonts. joerg Just in case it helps, Pablo -- Using Opera's revolutionary email client: http://www.opera.com/mail/ ___ 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] fluctuating baseline of header text
On 12/26/2014 11:32 PM, j. van den hoff wrote: > [...] > in this example (and with this font) the problem is only occuring when > toggling between pages 6/7 or 7/8 (at sufficient zoom it's easy to see), > i.e.the header is shifted downward on page 7. in other docs with different > fonts it happens across multiple pages. my guess would be it has to > do with the digit heights in the different fonts and the fact that the > page numbers are much larger than the heading, but that's only a guess. > > can someone confirm the problem? Hi Jörg, this sample shows the issue without zooming: \setuppapersize[A8] \setupheader [style=\itx\ss] \setupheadertexts [section] \setuppagenumbering[location={header,margin}, style=\bfd] \starttext \dorecurse{80}{\section{Introduction} bla\page[yes]} \stoptext When the glyph 7 is involved in page number, baseline is a bit lower. As you wrote, I guess this is related with the glyph metrics. Just in case it helps, Pablo -- http://www.ousia.tk ___ 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 ___