On Tue, 5 Dec 2023 20:06:46 +0100
Wolfgang Schuster wrote:
> > That doesn't make sense, inch and mm are different units. I'd rather
> > add:
> >
> >\registerunit
> > [inHg=inchmercury]
> >
> >\setupunittext
> > [en]
> >
Marco Patzer schrieb am 05.12.2023 um 19:58:
\setupunittext[en][millimetermercury=inHg]
That doesn't make sense, inch and mm are different units. I'd rather
add:
\registerunit
[inHg=inchmercury]
\setupunittext
[en]
[inchmercury=inHg]
It's just a stupid example to show
ick reply.
> \setupunittext[en][millimetermercury=inHg]
That doesn't make sense, inch and mm are different units. I'd rather
add:
\registerunit
[inHg=inchmercury]
\setupunittext
[en]
[inchmercury=
[physics.units]
%% inch should render as “in”
%% \setupunittext [inch=in]
\starttext
\unit{mercury}\crlf %% renders: mm · m
\unit{12 millimetermercury}\crlf %% renders: mm · m
\unit{12 inchmercury}\crlf%% renders: in · m
%% why is this necessary to get mercury rendered as Hg
, not as mmHg
\unit{millimetermercury}
How to get millimetermercury render as mmHg? And “inch mercury”
render as inHg? I can't find “inchmercury” in phys-dim.lua, only
“millimetermercury”, should it be added?
Example:
%% \enabletrackers [physics.units]
%% inch should render as “in”
%% \setupunittext
Marco Patzer schrieb am 03.10.2023 um 12:31:
Hi!
I struggle using the unit Farad (unit of capacitance):
The unit "farad" exists.
\starttext
%% prints 10 10 ft
\unit{10 F}
\unit{20 ft}
\registerunit [F=Farad]
\setupunittext [Farad=F]
%% prints 10 F 20 F⋅t
\unit{10 F}
\
Hi!
I struggle using the unit Farad (unit of capacitance):
\starttext
%% prints 10 10 ft
\unit{10 F}
\unit{20 ft}
\registerunit [F=Farad]
\setupunittext [Farad=F]
%% prints 10 F 20 F⋅t
\unit{10 F}
\unit{20 ft}
\stoptext
When registering Farad as new unit it messes up feet. This looks
like
ing at why my \registerunit attempt failed, I found that when you register
a unit, both your capitalization, and an all lowercase version are registered.
Here is an example, where I register “ReTeM” but \unit{1 retem} also works.
\starttext
\registerunit[unit][ReTeM=myunit]
\setupunittext[myun
ing now.
Looking at why my \registerunit attempt failed, I found that when you register
a unit, both your capitalization, and an all lowercase version are registered.
Here is an example, where I register “ReTeM” but \unit{1 retem} also works.
\starttext
\registerunit[unit][ReTeM=myunit]
\se
quires mucking around in
phys-dim.lua, which I’m not going to touch.
Use \unit{135 celsius} if you want the space, and 135\unit{celsius} if you
don’t. Or you can add your favorite abbreviations:
\registerunit[
°C=°C,
]
\setupunittext[
°C=℃,
]
Then use \unit{135°C} if you want the space a
with \registerunit[unit] and \setupunittext (see line 652 in
phys-dim.mkiv):
\starttext
\registerunit
[unit]
[minute=minute]
\setupunittext
[minute=min]
\unit{45 minute}
\stoptext
However, I'm unable to explain what exactly \registerunit or \setupunittext
does.
--
Romain Diss
romain.d...@yahoo.fr
kilometersolidushour
ConTeXt:
ver: 2012.08.16 22:20 MKIV fmt: 2012.8.22
phys-dim.mkiv
%\ctxlua{
%languages.labels.define(setupprefixtext,prefixes)%
%languages.labels.define(setupunittext,units)%
%languages.labels.define(setupoperatortext,operators)%
%languages.labels.define
\starttext
\defineunits[lunit]\lunit{10 l/s}\par
\defineunits[funit][label=foo] \funit{10 l/s}\par
\defineunits[bunit][label=bar] \bunit{10 l/s}\par
\stoptext
Maybe better:
\definelabelclass[unit]
…
\setupunittext[liter=l]
Wolfgang
13 matches
Mail list logo