From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Score sums and references
Date: Wed, 13 Dec 2023 09:39:26 +0100 [thread overview]
Message-ID: <5b138cfa-51db-4b01-94bd-e53f4fff121c@xs4all.nl> (raw)
In-Reply-To: <CAKyqqaYbWs+0SUgWi_9LPdskc3FAqRcJei71Y+2Zti0eAK97OQ@mail.gmail.com>
On 12/13/2023 4:05 AM, Jairo A. del Rio wrote:
> Hi, dear list. Is there a proper "ConTeXt way" to do the following?
>
> \integerdef\lmao=0
> \starttext
> Sum: \in[trick] % 10 from the result below
>
> +1\advance\lmao\plusone
>
> +2\advance\lmao\plustwo
>
> +3\advance\lmao\plusthree
>
> +4\advance\lmao\plusfour
>
> \normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
> \stoptext
>
> I want the result of a sum (either via Lua or TeX) to be printed before
> summands in text, but without the mess of reference options such as
> interaction, etc. Thank you in advance and sorry for any inconvenience.
\integerdef\DSlmao=0
\starttext
Sum: \datasetvariable{test-1}{1}{whatever}
\startlines
+1\advance\DSlmao\plusone
+2\advance\DSlmao\plustwo
+3\advance\DSlmao\plusthree
+4\advance\DSlmao\plusfour
\stoplines
\normalexpanded{\setdataset[test-1][whatever=\the\DSlmao]}
\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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2023-12-13 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 3:05 [NTG-context] " Jairo A. del Rio
2023-12-13 8:39 ` Hans Hagen [this message]
2023-12-14 2:56 ` [NTG-context] " Jairo A. del Rio
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=5b138cfa-51db-4b01-94bd-e53f4fff121c@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.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).