Expansion and database module
Hello all, My big weakness in TeX practice is working with the expansion. Perhaps because he speaks so Lua. I would like to ask whether there is any possibility of printing table columns (throw Mojca database module) when the column data are contained in a separate macro. Example: \usemodule[database] \defineseparatedlist [NaturalTable] [separator=comma, before=\bTABLE,after=\eTABLE, first=\bTR,last=\eTR, left=\bTD,right=\eTD] \def\tabrow{A, B, C} \starttext \startseparatedlist[NaturalTable] a,b,c A,B,C \stopseparatedlist \blank[big] \startseparatedlist[NaturalTable] \tabrow \stopseparatedlist %But I would like get table with three separate columns \stoptext While I can parsing column data contained in macro \tabrow, anyway I cant transmit column data to \startseparatedlist[NaturalTable] .. \stopseparatedlist environment to make it work. Thanx Jaroslav
On 30-7-2010 10:29, Jaroslav Hajtmar wrote:
Hello all,
My big weakness in TeX practice is working with the expansion. Perhaps because he speaks so Lua. I would like to ask whether there is any possibility of printing table columns (throw Mojca database module) when the column data are contained in a separate macro.
Example:
\usemodule[database]
\defineseparatedlist [NaturalTable] [separator=comma, before=\bTABLE,after=\eTABLE, first=\bTR,last=\eTR, left=\bTD,right=\eTD]
\def\tabrow{A, B, C}
\starttext
\startseparatedlist[NaturalTable] a,b,c A,B,C \stopseparatedlist
\blank[big]
\startseparatedlist[NaturalTable] \tabrow \stopseparatedlist
\expanded{\startseparatedlist[NaturalTable] \tabrow} \stopseparatedlist might work
%But I would like get table with three separate columns
\stoptext
While I can parsing column data contained in macro \tabrow, anyway I cant transmit column data to \startseparatedlist[NaturalTable] .. \stopseparatedlist environment to make it work.
Thanx Jaroslav
___________________________________________________________________________________
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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Thanx Hans, but your example do not print anything. I dont know why, but output is empty... Jaroslav Dne 30.7.2010 10:34, Hans Hagen napsal(a):
On 30-7-2010 10:29, Jaroslav Hajtmar wrote:
Hello all,
My big weakness in TeX practice is working with the expansion. Perhaps because he speaks so Lua. I would like to ask whether there is any possibility of printing table columns (throw Mojca database module) when the column data are contained in a separate macro.
Example:
\usemodule[database]
\defineseparatedlist [NaturalTable] [separator=comma, before=\bTABLE,after=\eTABLE, first=\bTR,last=\eTR, left=\bTD,right=\eTD]
\def\tabrow{A, B, C}
\starttext
\startseparatedlist[NaturalTable] a,b,c A,B,C \stopseparatedlist
\blank[big]
\startseparatedlist[NaturalTable] \tabrow \stopseparatedlist
\expanded{\startseparatedlist[NaturalTable] \tabrow} \stopseparatedlist
might work
%But I would like get table with three separate columns
\stoptext
While I can parsing column data contained in macro \tabrow, anyway I cant transmit column data to \startseparatedlist[NaturalTable] .. \stopseparatedlist environment to make it work.
Thanx Jaroslav
___________________________________________________________________________________
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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
appendix: Is it possible that the error is in the Mojca database module?? Jaroslav Dne 30.7.2010 10:50, Jaroslav Hajtmar napsal(a):
Thanx Hans, but your example do not print anything. I dont know why, but output is empty...
Jaroslav
Dne 30.7.2010 10:34, Hans Hagen napsal(a):
On 30-7-2010 10:29, Jaroslav Hajtmar wrote:
Hello all,
My big weakness in TeX practice is working with the expansion. Perhaps because he speaks so Lua. I would like to ask whether there is any possibility of printing table columns (throw Mojca database module) when the column data are contained in a separate macro.
Example:
\usemodule[database]
\defineseparatedlist [NaturalTable] [separator=comma, before=\bTABLE,after=\eTABLE, first=\bTR,last=\eTR, left=\bTD,right=\eTD]
\def\tabrow{A, B, C}
\starttext
\startseparatedlist[NaturalTable] a,b,c A,B,C \stopseparatedlist
\blank[big]
\startseparatedlist[NaturalTable] \tabrow \stopseparatedlist
\expanded{\startseparatedlist[NaturalTable] \tabrow} \stopseparatedlist
might work
%But I would like get table with three separate columns
\stoptext
While I can parsing column data contained in macro \tabrow, anyway I cant transmit column data to \startseparatedlist[NaturalTable] .. \stopseparatedlist environment to make it work.
Thanx Jaroslav
___________________________________________________________________________________
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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 30-7-2010 10:53, Jaroslav Hajtmar wrote:
appendix: Is it possible that the error is in the Mojca database module??
no, it's related to the nature of the module ... it operates on raw data and avoids expansion as well as uses line endings with a different catcode ... there is no way around it and as the module is already somewhat complex it will not be touched it might be easier to manage your data in lua tables and then write out context commands Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Jaroslav Hajtmar