From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@freedom.nl>
Subject: [NTG-context] Re: get measures as dimension in Lua
Date: Thu, 13 Jun 2024 23:03:04 +0200 [thread overview]
Message-ID: <ac4f99aa-bdb6-4b2e-b4f1-cd89c1e9beb0@freedom.nl> (raw)
In-Reply-To: <8756f0ff-71ab-4282-a1b5-eae9a683a481@fiee.net>
On 6/13/2024 7:24 PM, Henning Hraban Ramm wrote:
> Am 10.06.24 um 10:58 schrieb Henning Hraban Ramm:
>
>>> local namespace = tokens.getters.macro("??measure")
>>>
>>> function tex.getmeasure(name,asdimen)
>>> local value = tex.getdimensionvalue(namespace..name)
>>> if asdimen then
>>> return value .. "sp"
>>> else
>>> return value
>>> end
>
> So I needed just tex.getdimensionvalue(namespace..name)
just use tex.getmeasure in the upcoming
>> Not to be misunderstood, I couldn’t check yet, maybe I wasn’t clear:
>>
>> I need to process the measure as a dimension, like \measured{Bleed}.
>>
>> As far as I tried, neither tex.measured nor context.measured worked
>> (but I wouldn’t swear on it, maybe I had a different error).
>
> I understand now that a dimension in Lua is just a string.
no, it is a number (scaled points or sp) but it can have a string
representation
> I also messed a few thing up when I converted my macros from
> measure-macros to measures.
>
> Now my image calculations work again. Phew!
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2024-06-13 21:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-09 20:12 [NTG-context] " Henning Hraban Ramm
2024-06-10 5:08 ` [NTG-context] " Max Chernoff
2024-06-10 8:28 ` Hans Hagen via ntg-context
2024-06-10 8:58 ` Henning Hraban Ramm
2024-06-13 17:24 ` Henning Hraban Ramm
2024-06-13 21:03 ` Hans Hagen via ntg-context [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac4f99aa-bdb6-4b2e-b4f1-cd89c1e9beb0@freedom.nl \
--to=ntg-context@ntg.nl \
--cc=j.hagen@freedom.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).