Otared Kavian schrieb am 14.03.2024 um 14:48:
Dear Emmanuel,

Thank you for your reply: indeed I understand your approach, which is quite efficient. I am not at all good in coding, so I naively thought there would be a way for your setup to retrieve the information it needs from what the user is doing. Maybe once things are settled, Hans and Wolfgang will have a look in the Japanese part of ConTeXt so that the user can avoid to enter the setup included in the \directlua part.

There is no need for these calculations because

    1. you can create named layouts (e.g. \definelayout[kinohanmen:a4]) for each paper size,

    2. you can put the fontsize etc. settings in a setups block and load the one needed for each paper size and

    3. you can put all of them in a module which can be loaded when writing documents in japanese, the paper size can be passed as argument to the module.

Wolfgang