At the meeting I noted a few units that I didn’t know about, while I already knew many. * general units: in, m, cm, mm (ft?) * typographical units: pt, dd, bp, pc, cc, sp * font related: em, ex, fs, fa, fd, fc, ch * layout related: pw, ph, tw, th, cw, cd, lw, hs, vh * frame related: fw, fh, fo * funits: dk, es, tv, eu Are there even more? (Did you know all of them? This will be in the test…) Questions: How differs "1" from "2"? * em fs * lw hs * ph vh I want to update https://wiki.contextgarden.net/Dimensions Hraban
Henning Hraban Ramm schrieb am 25.08.2024 um 13:45:
At the meeting I noted a few units that I didn’t know about, while I already knew many.
* general units: in, m, cm, mm (ft?) * typographical units: pt, dd, bp, pc, cc, sp * font related: em, ex, fs, fa, fd, fc, ch * layout related: pw, ph, tw, th, cw, cd, lw, hs, vh * frame related: fw, fh, fo * funits: dk, es, tv, eu
Are there even more?
Yes, there are more of them. Look into the lowlevel-registers document which describes how they are created and also how you can define your own identifiers with \newuserunit.
Questions:
How differs "1" from "2"? * em fs
\startbuffer[dimensions] \starttabulate \NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize \stoptabulate \stopbuffer \starttext \getbuffer[dimensions] \setupbodyfont[14.4pt] \getbuffer[dimensions] \stoptext
* lw hs
lw stands for \linewidth which is the default value for rulethickness in \framed etc. hs is just \hsize.
* ph vh
ph is \paperheight. vh doesn't exist. Wolfgang
Am 25.08.24 um 14:15 schrieb Wolfgang Schuster:
Are there even more?
Yes, there are more of them.
Look into the lowlevel-registers document which describes how they are created and also how you can define your own identifiers with \newuserunit.
Thank you! There must have been a manual, but I didn’t guess “registers” was relevant.
Questions:
How differs "1" from "2"? * em fs
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
Ok, so they can differ minimally; in my 10pt setup I get the same value.
* lw hs
lw stands for \linewidth which is the default value for rulethickness in \framed etc.
I mixed up \linewidth with \textwidth, thought the one was LaTeX and the other \ConTeXt, since we’re talking about rulewidth otherwise.
hs is just \hsize.
Then it makes sense.
* ph vh ph is \paperheight. vh doesn't exist.
Ok, I had mis-noted vh from some older talk, meeting, or whatever, and forgot vs. Hraban
Am 25.08.24 um 15:52 schrieb Henning Hraban Ramm:
vh doesn't exist.
Ok, I had mis-noted vh from some older talk, meeting, or whatever, and forgot vs.
Stumbled upon it again: At the end of https://www.tug.org/TUGboat/tb42-3/tb132hagen-dk.pdf Hans wrote: vw (relative to the \hsize), vh (relative to the \vsize), maybe a percentage (but of what) and ch (width of the current zero digit character). As if that wasn’t official documentation… WRT to funits see also https://www.tug.org/TUGboat/tb44-2/tb137egger-edith.pdf HR
On 8/25/2024 2:15 PM, Wolfgang Schuster wrote:
How differs "1" from "2"? * em fs
\startbuffer[dimensions] \starttabulate \NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth \NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize \stoptabulate \stopbuffer
\starttext
\getbuffer[dimensions]
\setupbodyfont[14.4pt]
\getbuffer[dimensions]
\stoptext Often they are the same (basically font units) but there can be some rounding going on; also bodyfont sizes are clipped
\starttext \the\numexpr(\dimexpr1fs\relax/65536)*100\relax\par \the\numexpr(\dimexpr1em\relax/65536)*100\relax \the\dimexpr1fs\relax\par \the\dimexpr1em\relax \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Henning Hraban Ramm
-
Wolfgang Schuster