> On 13 Feb 2018, at 17:38, Hans Hagen <[email protected]> wrote:
>
>> […]
>
> context.goto( "Index", { "ref:index" })
>
> \def\foo#1#2{....}
>
> context.foo("a","b")
>
> \def\foo[#1][#2]{....}
>
> context.foo( { "a" }, { "b" } )
>
> etc
Hi Hans,
Thanks for your attention, your quick response and the hints, especially
regarding the definition of a command with brackets.
Indeed, as you may see with the following modified example,
context.goto("Index",{"ref:index"})
generates an error, maybe because of a delimiter issue with the definition of
\goto.
However, after defining a \MyGoTo command with delimiters being explicitely
brackets, then
context.MyGoTo({"Index"},{"ref:index"})
works fine, as well as
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
so that my problem is solved…
Best regards: OK
%% begin test-lua-reference.tex
\setupinteraction[state=start]
\def\MyGoTo[#1][#2]{\goto{#1}[#2]}
\starttext
\startchapter[title={Ward},reference={ch:ward}]
\startluacode
context.index("Knuth")
context.index("Ward")
context("Read Knuth and see also the ")
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
-- context.goto("Index",{"ref:index"}) -- this does not work
\stopluacode
\input ward.tex
\stopchapter
\starttitle[title={Index}]
\startluacode
local s,t = "ref:","index"
context.pagereference({"ref:index"})
\stopluacode
\placeindex
\stoptitle
\stoptext
%% end test-lua-reference.tex
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________