Hi, I uploaded a new lmtx (some new - experimental - things will be explained after the ctx meeting), but there's one thing that is somewhat important. In addition to the built in units we can now have so called user units. There is some more info about this in the lowlevel-registers manual. One of the predefined units is 'uu' with an associated \ununit (dimension) variable and it's is also interfaced to metafun. That means that when you use uu in metapost graphics you have to make sure that you save the meaning and/or numeric uu now. The idea is that just as in mp one can say 20xx with xx being a (sort of) unit, one can do the same in tex. Think of \newdimension \MyUnitA \MyUnitA 1.23pt \pushoverloadmode % just in case \newuserunit\MyUnitA ua % binds the unit to the variable \popoverloadmode x\hskip 10ua\relax x The units starting with 'u' are considered user units but be carefulk with other combinations as we have (and will have more) built into context ones, like pi : pi for Mikael ft : foot for Alan fs : (global body) font size tw : (layout) text width th : (layout) text height hs : (current) hsize vs : (current) vsize cd : (when set) column distance cw : (when set) column width cx : combination cell width uu : user unit (\METAFUN) So Mikael can now have test \hskip 3pi\relax test and Alan can have \setuplayout [width=1ft] to be consistent with inches. The reason why we have this mechanism is that it provides a level of abstraction. It might evolve over time but don't expect the 600+ units possible to show up because one needs sensible shortcuts. Already built in unit always win and you cna only bind to already defined quantities. Here's one for those who want to go beyond the normal: \newdimension \FooA \FooA 1.23pt \newdimen \FooB \FooB 12.3pt \protected\def\FooC {\the\dimexpr\FooA +\FooB\relax} So you can now figure how 'cx' is defined in a dynamic way. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 8/15/23 19:08, Hans Hagen wrote:
[...] The units starting with 'u' are considered user units but be carefulk with other combinations as we have (and will have more) built into context ones, like
pi : pi for Mikael ft : foot for Alan fs : (global body) font size tw : (layout) text width th : (layout) text height hs : (current) hsize vs : (current) vsize cd : (when set) column distance cw : (when set) column width cx : combination cell width uu : user unit (\METAFUN)
Many thanks for the new release, Hans. I wonder whether we could have (current) frame width and height as unit. Many thanks for your help, Pablo
On 8/15/2023 9:27 PM, Pablo Rodriguez wrote:
On 8/15/23 19:08, Hans Hagen wrote:
[...] The units starting with 'u' are considered user units but be carefulk with other combinations as we have (and will have more) built into context ones, like
pi : pi for Mikael ft : foot for Alan fs : (global body) font size tw : (layout) text width th : (layout) text height hs : (current) hsize vs : (current) vsize cd : (when set) column distance cw : (when set) column width cx : combination cell width uu : user unit (\METAFUN)
Many thanks for the new release, Hans.
I wonder whether we could have (current) frame width and height as unit. we can have
fw fh fo lw (width height offset linewidth) but keep in mind that only properties that are set up have a meaningful value (so with autoheight it is zero) and then you realize that you are the one going to wikify it Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 8/15/23 22:16, Hans Hagen via ntg-context wrote:
On 8/15/2023 9:27 PM, Pablo Rodriguez wrote:
[...] I wonder whether we could have (current) frame width and height as unit. we can have
fw fh fo lw (width height offset linewidth)
but keep in mind that only properties that are set up have a meaningful value (so with autoheight it is zero)
So 1fw is equal to 2fo + 1lw, isn’t it? (I mean, frame width is left and right offset [given that all frames have the same length] plus line width.) Sorry, this is to be sure I’m getting this right.
and then you realize that you are the one going to wikify it
Fine (https://wiki.contextgarden.net/Dimensions could be expanded that way), but I need to check the new units first. Many thanks for your help, Pablo
On 8/15/2023 10:54 PM, Pablo Rodriguez wrote:
On 8/15/23 22:16, Hans Hagen via ntg-context wrote:
On 8/15/2023 9:27 PM, Pablo Rodriguez wrote:
[...] I wonder whether we could have (current) frame width and height as unit. we can have
fw fh fo lw (width height offset linewidth)
but keep in mind that only properties that are set up have a meaningful value (so with autoheight it is zero)
So 1fw is equal to 2fo + 1lw, isn’t it? (I mean, frame width is left and right offset [given that all frames have the same length] plus line width.)
fw is more like width-2offset-2linewidth
Sorry, this is to be sure I’m getting this right. we can also have (available)
lh lineheight sh strutheight sd strutdepth and maybe (pick up from font or have extra font dimens) fa font ascender fd font descender fc font capheight and the css (easy) ch width of zero and then a kind of periodic table of units Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hi Pablo, I Uploaded an update so you can spend the evening wikifying units ... see lowlevel manual for the full list \startTEXpage[offset=1ex] x\vrule height 1fa depth 1fd\relax x % \ascender \descender x\vrule height 1sh depth 1sd\relax x % \strutht \strutdp x\vrule height 1fc depth 0pt\relax x % \capheight \stopTEXpage you can also run s-system-units.mkxl and get a unit map Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 8/16/23 19:46, Hans Hagen via ntg-context wrote:
Hi Pablo,
I Uploaded an update so you can spend the evening wikifying units ...
Hi Hans, many thanks for the update. As for yesterday, I’m afraid I was required elsewhere...
see lowlevel manual for the full list
Many thanks for adding that to the lowlevel manual. Just in case this might help anyone, I always see what is new in latest release by comparing the backup from previous latest with current latest (in my case "meld context .backup-context/date_context/"). I think the best way is to copy from section 6 of the manual.
\startTEXpage[offset=1ex] x\vrule height 1fa depth 1fd\relax x % \ascender \descender x\vrule height 1sh depth 1sd\relax x % \strutht \strutdp x\vrule height 1fc depth 0pt\relax x % \capheight \stopTEXpage
you can also run s-system-units.mkxl and get a unit map
I always forget how to run modules, so compiling this also works: \usemodule[system-units] \startTEXpage[offset=1ts] \showunitsmap \stopTEXpage Now I’m editing the dimensions entry in the wiki. Many thanks for your work again, Pablo
participants (3)
-
Hans Hagen
-
Hans Hagen
-
Pablo Rodriguez