[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread Wolfgang Schuster
ai2472206...@yeah.net schrieb am 29.05.2024 um 14:05: I'm defining a command to generate options for multiple choice questions, but at the moment I'm stuck at this step. I want to get a number and assign a value to the counter, but why can't I get it? %%%% \starttext \defin

[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread Taco Hoekwater
> it? > > > \starttext > \definedataset [myset] > \setdataset[myset] [foo=1,boo=4] > \newcount\tempa > \datasetvariable{myset}{1}{boo} % definitely get 4 > %\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa? > %\number\tempa > \stoptex

[NTG-context] Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
I'm defining a command to generate options for multiple choice questions, but at the moment I'm stuck at this step. I want to get a number and assign a value to the counter, but why can't I get it? %%%% \starttext \definedataset [myset] \setdataset[myset] [foo=1,boo=4]

[NTG-context] Re: Experiments with \doloopoverlist

2023-08-17 Thread Hans Hagen via ntg-context
size query so I added that. Your data is missins commas so let's fix that first \definedataset[autores] \setdataset[autores] [ nombre={Angie Natalia Farfán Acevedo}, cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002125949},

[NTG-context] Experiments with \doloopoverlist

2023-08-16 Thread Andres Conrado Montoya
oes not require inlineuserdata? %% MWE: \setupinteraction[state=start] \define[2]\imghref{\bgroup\goto{#1}[url(#2)]\egroup} \defineexternalfigure[logo][height=1em] \definedataset[autores] \setdataset[autores][ nombre={Angie Natalia Farfán Acevedo}, cvlac={ https://scienti.minciencias.gov.co/cvl

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
El mié, 24 de mar. de 2021 a la(s) 16:47, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 3/24/2021 6:33 PM, Jairo A. del Rio wrote: > > Hi, Hans. Here's my (miserably failing) attempt: > > > > \definedataset[nicedata] > > > > \starttext > > >

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Hans Hagen
On 3/24/2021 6:33 PM, Jairo A. del Rio wrote: Hi, Hans. Here's my (miserably failing) attempt: \definedataset[nicedata] \starttext \startluacode local name = "nicedata" -- For exposition only local function dofactorial(n) local function inner(c,m) if m<2 then return c

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
ribió: > On Wed, 24 Mar 2021, Jairo A. del Rio wrote: > > > Hi, Hans. Here's my (miserably failing) attempt: > > > > \definedataset[nicedata] > > > > \starttext > > > > \startluacode > > > > local name = "nicedata" > &

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
Hi, Hans. Here's my (miserably failing) attempt: \definedataset[nicedata] \starttext \startluacode local name = "nicedata" -- For exposition only local function dofactorial(n) local function inner(c,m) if m<2 then return c end return inner(c*m, m-1) end return inner

Re: [NTG-context] Quirk with \userpagenumber, datasets and the .tuc file

2020-12-09 Thread Hans Hagen
On 12/9/2020 1:08 PM, Bruce Horrocks wrote: Here's an odd quirk... I wanted to get at some of my dataset data for use outside of ConTeXt so I thought I would just extract it from the .tuc file. MWE: \definedataset [MyDS][delay=yes] \starttext \input tufte \setdataset

[NTG-context] Quirk with \userpagenumber, datasets and the .tuc file

2020-12-09 Thread Bruce Horrocks
Here's an odd quirk... I wanted to get at some of my dataset data for use outside of ConTeXt so I thought I would just extract it from the .tuc file. MWE: \definedataset [MyDS][delay=yes] \starttext \input tufte \setdataset [MyDS] [ title={Test title}, page={\userpagen

[NTG-context] store data in the first run for later runs?

2020-11-06 Thread Pablo Rodriguez
ter the first one see to empty the data in the Lua table. Adapting a sample from the wiki: \starttext \definedataset[somedataset] \startmode[*first] \setdataset[somedataset][wantscake=yes, wantsdeath=no] \stopmode Do you want cake? \datasetvariable{somedataset}{1}{wantscake}.\\ BTW,

Re: [NTG-context] invoking ConTeXt from .bat file in Win7

2020-10-28 Thread Pablo Rodriguez
t with the first run mode. \startmode[*first] \startluacode io.write("\n\n Document URL?") document.url_address = io.read() \stopluacode \definedataset[document_data] \setdataset[document_data] [url=\cldcontext{document.url_address}] \stopmode \star

Re: [NTG-context] Let chapter start on odd page and make the even page before show an image

2020-05-29 Thread Aditya Mahajan
On Fri, 29 May 2020, Jan U. Hasecke wrote: One and a half question. Why did you set \ChapterCounter explizitly and why is \ChapterCounter part of the datasetvariable? \dataset... is a high level interface for collecting two-pass data in ConTeXt. Here is a simple example: \definedataset

Re: [NTG-context] Let chapter start on odd page and make the even page before show an image

2020-05-29 Thread Jan U. Hasecke
Hi Wolfgang, thank you very much. Amazing! Am 29.05.20 um 15:35 schrieb Wolfgang Schuster: > \definedataset [chapter] > > \startsetups [chapter:before] > >   \page[yes] > >   \doglobal\increment\ChapterCounter > >   \doifoddpageelse >     {} >     {\doifsom

Re: [NTG-context] Let chapter start on odd page and make the even page before show an image

2020-05-29 Thread Wolfgang Schuster
  [alternative=doublesided] \setupexternalfigures   [location=default] \definedataset [chapter] \startsetups [chapter:before]   \page[yes]   \doglobal\increment\ChapterCounter   \doifoddpageelse     {}     {\doifsomething    {\datasetvariable{chapter}{\ChapterCounter}{image

Re: [NTG-context] fancy chapter setup

2020-01-13 Thread Wolfgang Schuster
on and the \page command in my setup, the header text changed too early. \definedataset[chapter] \startsetups[chapter:leftpage]     \page[left]     \doglobal\increment\ChapterData     \doifsomething{\datasetvariable{chapter}{\ChapterData}{subtitle}}     {     \starttabulate  

Re: [NTG-context] pagereferences

2016-01-17 Thread Wolfgang Schuster
er to change? You can use the dataset command which lets you store other information, e.g. the current value of the visible pagenumber. \definedataset[hans][delay=yes] \setupuserpagenumber[number=3] \starttext One\setdataset[hans][one][pagenumber=\userpagenumber] \page[+2] Two\setdataset[

Re: [NTG-context] deferred variable lookup in environment?

2013-02-01 Thread Marco Patzer
{\framed[frame=on, width=4cm, height=2cm]{%% \doiftextelse{\mydate}{\mydate}{\currentdate}}} \setupbackgrounds [page] [background=firstpage] \definedataset [mydata] \setdataset [mydata] [date] [date=2011-11-11] \starttext \doiftextelse{\mydate}{\mydate}{\currentdate} \stoptext Marco

Re: [NTG-context] Multipass Datasets doesn't work

2012-10-29 Thread Wolfgang Schuster
Am 29.10.2012 um 09:52 schrieb Martin Fechner : > Hello, > > the simple example from the mailing-list doesn't work with the latest beta. I > think the core-dat.lua is corrupted (function commands.datasetvariable) > > > \definedataset[test-1] > \defineda

[NTG-context] Multipass Datasets doesn't work

2012-10-29 Thread Martin Fechner
Hello, the simple example from the mailing-list doesn't work with the latest beta. I think the core-dat.lua is corrupted (function commands.datasetvariable) \definedataset[test-1] \definedataset[test-2] \starttext \setdataset[test-1][x=Value X 1,y=Value Y 1] \setdataset[test-1][x=Va

Re: [NTG-context] [.tuc] oddity when storing a table

2012-09-17 Thread Hans Hagen
arbitrary data to be stores you need to used datasets, as explained in http://wiki.contextgarden.net/Command/definedataset Hmm, the wiki only covers the TeX macro interface whilst I am mainly concerned with passing stuff right from the Lua end. From my reading of core-dat.lua I gather that there is

Re: [NTG-context] [.tuc] oddity when storing a table

2012-09-17 Thread Philipp Gesang
be stores you need to used datasets, > as explained in > > http://wiki.contextgarden.net/Command/definedataset Hmm, the wiki only covers the TeX macro interface whilst I am mainly concerned with passing stuff right from the Lua end. From my reading of core-dat.lua I gather that there is not

Re: [NTG-context] [.tuc] oddity when storing a table

2012-09-16 Thread Hans Hagen
g/context/tex/texmf-context/tex/context/base/cont-yes.mkiv: LuaTeX error ... ··· Bug? no, feature. job variables are just key/values and accessible at the tex end (you store 'works too' in 'bar') if you want arbitrary data to be stores you n

Re: [NTG-context] [dev-context] Storing and retrieving two-pass data

2012-04-20 Thread luigi scarso
ed to avoid.  Apparently I missed  the obvious, > there is no special magic needed: > > % doesn't seem to be necessary > % \definedataset [test] > > \setdataset [test] [foo] [foo=first] > \setdataset [test] [foo] [foo=second] > > \setdataset [test] [bar] [bar=first] &