[dev-context] \structurevariable

Hans Hagen pragma at wxs.nl
Fri Mar 2 20:55:45 CET 2012


On 24-2-2012 17:52, Wolfgang Schuster wrote:
> Hi Hans,
>
> the \structurevariable command which can be used the access the value in the headings don’t show any text because context looks into the wrong table.
>
> In strc-doc.lua something like this has to be changed (use the title data subtable):
>
> function sections.structuredata(depth,key,default,honorcatcodetable) -- todo: spec table and then also depth
>      if depth then
>          depth = levelmap[depth] or tonumber(depth)
>      end
>      if not depth or depth == 0 then
>          depth = data.depth
>      end
>      local data = data.status[depth]
> --  local d = data
>      local d = data.titledata
>> end

no, it's a wrong change from split to match ...

     for k in gmatch(key,"[^%.]+") do

and then

\startchapter[title={Hello World},marking={A}][mybla=whatever]

\starttabulate
\NC Title    \EQ \namedstructurevariable{chapter}{titledata.title}   \NC\NR
\NC Marking  \EQ \namedstructurevariable{chapter}{titledata.marking} \NC\NR
\NC Whatever \EQ \namedstructurevariable{chapter}{userdata.mybla} \NC\NR
\stoptabulate

\stopchapter



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-context mailing list