ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rudolf Bahr <quasi@quasi.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Exchangeing content of variables between luacode and context
Date: Tue, 19 Nov 2019 20:34:26 +0100	[thread overview]
Message-ID: <20191119193426.GA32147@nan> (raw)
In-Reply-To: <cecb89c1-e2a0-2bad-3a2c-272aa8f9e909@gmail.com>

On Tue, Nov 19, 2019 at 04:55:15PM +0100, Wolfgang Schuster wrote:
> 
> Can you make a minimal example of your actual problem.


No, sorry, I can't.

My 'actual problem' is more or less a design problem: Should in a book project
ConTeXt be the master and Luacode the slave or vice versa? Both seems possible.

The task to solve is to set a photo album with say 300 DIN A4 landscape pages.
On every page there should be 1 to 4 columns filled with photos and texts mostly
defined in layers.

Up to now I made all in ConTeXt manually by trying, for instance::
- To estimate the width of layers, if neighboured layers should contain photos of
  same height with respect to center horizontally all columns at end of page.
- To complete abbreviations of long picture names; it's rather annoying doing
  this by copy and paste with hundreds of photo names; instead I'd like to type
  a short code and Luacode should complete it to the full name.
- To estimate the shift amount of all columns together in order to horizontally
  get them centered on the page.

All of these tasks can be made best by Luacode functions. And I'd like to save
their results in the ConTeXt program permanently. With 'tokens.setters.macro()'
it's possible only in the same, Luacode calling ConTeXt run. In the following
run, the macro shows its original value again and the Luacode program must be
called again to alter it.

So I've to think about making Luacode the master and ConTeXt the slave. Then it'd
be possible to embody Luacode's results permanently in the ConTeXt code. Vice versa
a solution could be to store Luacode's results in a flattened Lua table on disc.
But the perfect relating to their ConTeXt page remains difficult when inserting
or deleting of pages in an ensemble of 300 pages should become necessary. Another
much simpler solution would be the proposal above, namely, to copy the ConTeXt
program step by step and page by page to another file and introducing the Luacode
results simultaneously. 

In [1] there is a chapter with "stepper" commands, but I didn't understand that,
so I can't say, whether they are suitable for this issue.

Rudolf

[1] Hans Hagen, "ConTeXt Lua Documents", January 12, 2018, 3.4, page 30
___________________________________________________________________________________
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:[~2019-11-19 19:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 13:19 Rudolf Bahr
2019-11-19 15:55 ` Wolfgang Schuster
2019-11-19 19:34   ` Rudolf Bahr [this message]
2019-11-20  6:43     ` Henning Hraban Ramm
2019-11-20  8:24     ` Hans Hagen
2019-11-20 16:57       ` Rudolf Bahr

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=20191119193426.GA32147@nan \
    --to=quasi@quasi.de \
    --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).