[NTG-context] Re: Table head/body via lua

2023-08-18 Thread Alexey Kryukov
On Fri, 18 Aug 2023 21:11:38 +0200
Wolfgang Schuster wrote:

> What you can do here is to put the table together piece by piece with 
> the collecting
> mechanism which collect parts of the table until you flush the whole 
> collection
> at the end with the \stopcollecting command.

Many thanks, I'll try this.

-- 
Regards,
Alexey Kryukov 

Moscow State University
Faculty of History
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Table head/body via lua

2023-08-18 Thread Wolfgang Schuster

Alexey Kryukov schrieb am 18.08.2023 um 20:31:

On Fri, 18 Aug 2023 20:12:33 +0200
Wolfgang Schuster wrote:


Do you create the whole table with Lua? When this is the case a small
change to the table section
commands on the Lua side can fix your problems but otherwise a
different approach is needed.

Hi Wolfgang,

thanks for the answer. Basically I would like to typeset a document
represented as TEI xml. Unfortunately, TEI support for table typesetting
is rather limited: there are no tags corresponding to table head of
body. It is only possible to specify a specific role for some rows.
So I have to use lua code to add head/body markup where appropriate,
and that's exactly what I can't do due to the described problem.

If there is no better solution, I can simply extend my xml with custom
tags, but I would like to keep it as TEI compliant as possible.


What you can do here is to put the table together piece by piece with 
the collecting
mechanism which collect parts of the table until you flush the whole 
collection

at the end with the \stopcollecting command.

\starttext

\bTABLE
\startcollecting
\startcollect
\bTABLEbody
\stopcollect
\startcollect
\bTR
\bTD Cell 1\eTD
\bTD Cell 2\eTD
\eTR
\stopcollect
\startcollect
\eTABLEbody
\stopcollect
\stopcollecting
\eTABLE

\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Table head/body via lua

2023-08-18 Thread Alexey Kryukov
On Fri, 18 Aug 2023 20:12:33 +0200
Wolfgang Schuster wrote:

> Do you create the whole table with Lua? When this is the case a small 
> change to the table section
> commands on the Lua side can fix your problems but otherwise a
> different approach is needed.

Hi Wolfgang,

thanks for the answer. Basically I would like to typeset a document
represented as TEI xml. Unfortunately, TEI support for table typesetting
is rather limited: there are no tags corresponding to table head of
body. It is only possible to specify a specific role for some rows.
So I have to use lua code to add head/body markup where appropriate,
and that's exactly what I can't do due to the described problem.

If there is no better solution, I can simply extend my xml with custom
tags, but I would like to keep it as TEI compliant as possible.

-- 
Regards,
Alexey Kryukov 

Moscow State University
Faculty of History
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Table head/body via lua

2023-08-18 Thread Wolfgang Schuster

Alexey Kryukov schrieb am 18.08.2023 um 19:02:

Hi,

I am trying to generate a table representation for some xml source.
As the data structure doesn't directly correspond to the desired table
structure, some manipulations via lua are required. So far everything
works OK except table sectioning commands, like \bTABLEhead,
\eTABLEhead, bTABLEbody or \eTABLEbody: it seems impossible to
incapsulate them into lua functions. For example, the following is not
compiled:

\starttext
\bTABLE
\ctxlua{context.bTABLEbody()}
\bTR
\bTD Cell 1\eTD
\bTD Cell 2\eTD
\eTR
\ctxlua{context.eTABLEbody()}
\eTABLE
\stoptext

Can anybody suggest a workaround (except changing the source XML of
course)?


Do you create the whole table with Lua? When this is the case a small 
change to the table section
commands on the Lua side can fix your problems but otherwise a different 
approach is needed.


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___