ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Score sums and references
@ 2023-12-13  3:05 Jairo A. del Rio
  2023-12-13  8:39 ` [NTG-context] " Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Jairo A. del Rio @ 2023-12-13  3:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 551 bytes --]

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.

Regards,

Jairo

[-- Attachment #1.2: Type: text/html, Size: 646 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: Score sums and references
  2023-12-13  3:05 [NTG-context] Score sums and references Jairo A. del Rio
@ 2023-12-13  8:39 ` Hans Hagen
  2023-12-14  2:56   ` Jairo A. del Rio
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2023-12-13  8:39 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [NTG-context] Re: Score sums and references
  2023-12-13  8:39 ` [NTG-context] " Hans Hagen
@ 2023-12-14  2:56   ` Jairo A. del Rio
  0 siblings, 0 replies; 3+ messages in thread
From: Jairo A. del Rio @ 2023-12-14  2:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2089 bytes --]

Cool. It works once \startlines ... \stoplines is removed. Thank you
very much!

Jairo

El mié, 13 dic 2023 a la(s) 3:40 a.m., Hans Hagen (j.hagen@xs4all.nl)
escribió:

> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-14  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13  3:05 [NTG-context] Score sums and references Jairo A. del Rio
2023-12-13  8:39 ` [NTG-context] " Hans Hagen
2023-12-14  2:56   ` Jairo A. del Rio

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).