Changes

Jump to navigation Jump to search
1,334 bytes added ,  22:09, 8 May 2012
Better description, better example
== Description ==
This command stores twoDefine a dataset, inside which key-pass data value tables can be stored with {{cmd|setdataset}}. If any tables are defined, the dataset is stored in the <code>.tuc</code> file. If the optional second argument <code>[delay=yes]</code> is added, each table stored in this dataset will have three extra entries: <code>index</code> and <code>order</code> will both contain the number (1, 2, 3, ...) of the {{cmd|setdataset}} call that defined the table; <code>realpage</code> will contain the number of the PDF page that TeX was working on when the table was stored with {{cmd|setdataset}}.
== Usage ==
 
Here is an example where the dataset is defined with the <code>[delay=yes]</code> option. If the option had not been given, the <code>index</code>, <code>order</code>, and <code>realpage</code> entries would simple be missing.
<texcode>
% Create the dataset `mydata`\definedataset [somedatasetmydata][delay=yes] % index=1, realpage=2\setdataset[mydata][goldfish][colour=gold]</texcode>% index=2, realpage=1\setdataset[mydata][silverfish][type=insect]\page[yes]
or% index=3, realpage=2; overwrites previous goldfish table.\setdataset[mydata][goldfish][type=fish]
<texcode>% Results in the following Lua table in the .tuc file\definedataset % [somedataset"mydata"] ={% [delay"goldfish"]=yes{% ["type"]="fish",% ["index"]=3,% ["order"]=3,% ["realpage"]=2,% },% ["goldfish"]={% ["type"]="insect",% ["index"]=2,% ["order"]=2,% ["realpage"]=1,% },% }
</texcode>
== See also ==
<!-- something like {{cmd|goto}} -->
 
More detailled explanations and examples can be found under
[[System_Macros/Key_Value_Assignments|Key-Value Assignments]] section Two-pass data.
 
 
{{cmd|setdataset}},
{{cmd|datasetvariable}}
* {{cmd|setdataset}} to store a key-value tables in a dataset
* {{cmd|datasetvariable}} to retrieve a value from a key-value table in a dataset
* More detailed explanations and examples can be found in the Key-Value Assignments article, under the section [[System_Macros/Key_Value_Assignments#Multi-pass data|Multi-pass data]].
== Help from ConTeXt-Mailinglist/Forum ==
{{Forum|{{SUBPAGENAME}}}}
[[Category:CommandsCommand/Datasets|definedataset]]

Navigation menu