![](https://secure.gravatar.com/avatar/74d41c3215dcdd377343cdc47311757c.jpg?s=120&d=mm&r=g)
19 May
2023
19 May
'23
4:15 a.m.
Gerben Wierda via ntg-context schrieb am 19.05.2023 um 11:43:
I want to use a variable for a font size so I can set it based on language (as some translated texts have widely different sizes)
This fails:
%=========================== \newdimen\relationsFontSize \relationsFontSize=8pt \starttext \switchtobodyfont[\relationsFontSize] Hello, world! \stoptext %===========================
How can I use a variable to steer \switchtobodyfont size?
You need \the\<register>, i.e. \switchtobodyfont[\the\relationsFontSize] but I would use the measure command, e.g. \definemeasure[relationsFontSize][8pt] \starttext \switchtobodyfont[\measure{relationsFontSize}] Hello, world! \stoptext Wolfgang