ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sylvain Hubert <champignoom@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: context.delayed as parameter of setuphead[before=...]
Date: Tue, 3 Nov 2020 04:05:39 +0100	[thread overview]
Message-ID: <CACNy3NBJfPS0AnxZzG06P9eS62PtXt48wZMzKUTRvoFg2XxoTQ@mail.gmail.com> (raw)
In-Reply-To: <CAKyqqaY7pOfF42u7W1y3qBCin4M7xzvBkcu3uuHx-yBrop6M0Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3086 bytes --]

> as tables like those in setuphead({somehead}, {somesettings}) are actual
Lua tables and follow Lua, not TeX, rules
But there are lua apis that support delayed TeX like
`context.chapter(context.delayed'text')`.
Whether or not the function is stored in a table should be theoretically
irrelevant.
I guess there should be a switch somewhere that let the command recognized
delayed function.

On Tue, 3 Nov 2020 at 03:29, Jairo A. del Rio <jairoadelrio6@gmail.com>
wrote:

> On the Lua side, you'll have to pass strings so your example works, as
> tables like those in setuphead({somehead}, {somesettings}) are actual Lua
> tables and follow Lua, not TeX, rules (see e.g. Lua reference in
> https://www.lua.org/manual/5.4/ or, better, CLD manual in
> http://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf):
>
>
> \starttext
>
> \startluacode
>
> --First example
>
> for m = 1, 3 do
>
> context.setuphead({'chapter'}, {before='hello'})
>
> context.startchapter({title="I'm a chapter!"})
>
> for i = 1, 3 do
>
> context.input("knuth")
>
> end
>
> context.stopchapter()
>
> end
>
>
> --Second example
>
> --We'll pass some strings to TeX
>
> local nice = "ConTeXt is love, ConTeXt is life"
>
> local somehead = 'chapter'
>
> local sometext = 'vallejo-trilce-es'
>
>
> context.setuphead({somehead}, {before=nice})
>
> context.startchapter({title=somehead})
>
> context.input(sometext)
>
> context.stopchapter()
>
> \stopluacode
>
> \stoptext
>
>
> I hope examples help.
>
> Regards,
>
> Jairo :)
>
>
>
> El lun., 2 de nov. de 2020 a la(s) 21:09, Sylvain Hubert (
> champignoom@gmail.com) escribió:
>
>> Dear List,
>>
>> I'm trying to mirror the context command
>>   `\setuphead[chapter][before=hello]`
>> into lua with delayed typesetting of 'hello', but
>>   `\ctxlua{context.setuphead({'chapter'},
>> {before=context.delayed'hello'})}`
>> does not have any effect. Could anyone help me on this? Thanks!
>>
>> Best,
>> Sylvain
>>
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> 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
>>
>> ___________________________________________________________________________________
>>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 6827 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

  reply	other threads:[~2020-11-03  3:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  2:09 Sylvain Hubert
2020-11-03  2:28 ` Jairo A. del Rio
2020-11-03  3:05   ` Sylvain Hubert [this message]
2020-11-03  4:03     ` Jairo A. del Rio
2020-11-03  8:03     ` Hans Hagen
2020-11-04 15:53       ` Sylvain Hubert
2020-11-04 16:35         ` Hans Hagen
2020-11-04 17:17           ` Sylvain Hubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACNy3NBJfPS0AnxZzG06P9eS62PtXt48wZMzKUTRvoFg2XxoTQ@mail.gmail.com \
    --to=champignoom@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).