[NTG-context] How to get \structurenumber and \structuretitle by Lua?

Procházka Lukáš Ing. - Pontex s. r. o. LPr at pontex.cz
Wed Apr 18 10:03:54 CEST 2012


Hello Hans,

thanks for the idea.

Unfortunately, I'm getting error:

----
\starttext
   \section{A}
     \subsection{Aa}
       \subsubsection{Aaa}

         \startluacode
             print("@@@", structures.sections.getnumber(2))
         \stopluacode
\stoptext
----

"
! LuaTeX error ...TeXt/tex/texmf-context/tex/context/base/strc-doc.lua:762: attempt to index field 'references' (a nil value)
stack traceback:
	...TeXt/tex/texmf-context/tex/context/base/strc-doc.lua:762: in function 'findnumber'
	...TeXt/tex/texmf-context/tex/context/base/strc-doc.lua:863: in function 'getnumber'
	<main ctx instance>:2: in main chunk.
"

How would I get the text? With "structures.sections.gettitle(2)"?

Best regards,

Lukas


On Tue, 17 Apr 2012 19:20:42 +0200, Hans Hagen <pragma at wxs.nl> wrote:

> structures.sections.getnumber(2)
>
> gives the number at level 2


-- 
Ing. Lukáš Procházka [mailto:LPr at pontex.cz]
Pontex s. r. o.      [mailto:pontex at pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t-CurSec2.log
Type: application/octet-stream
Size: 13967 bytes
Desc: not available
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20120418/1bb7c97f/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t-CurSec2.mkiv
Type: application/octet-stream
Size: 225 bytes
Desc: not available
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20120418/1bb7c97f/attachment-0003.obj>


More information about the ntg-context mailing list