ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* embedding ConTeXt code in an xtable
@ 2013-06-15 16:01 Sander Maijers
  2013-06-15 17:42 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Sander Maijers @ 2013-06-15 16:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I am now using xtable to have an XMLish document to store a table. How 
I can embed ConTeXt code like $\Delta{}N_{\text{test}}$
in the external XML file file with the table? In other words, having 
mathematical notiation in the table header?

I tried various things such as:
\expanded{\xmlflush{#1}}

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: embedding ConTeXt code in an xtable
  2013-06-15 16:01 embedding ConTeXt code in an xtable Sander Maijers
@ 2013-06-15 17:42 ` Wolfgang Schuster
  2013-06-16 15:05   ` Sander Maijers
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2013-06-15 17:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.06.2013 um 18:01 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:

> I am now using xtable to have an XMLish document to store a table. How I can embed ConTeXt code like $\Delta{}N_{\text{test}}$
> in the external XML file file with the table? In other words, having mathematical notiation in the table header?
> 
> I tried various things such as:
> \expanded{\xmlflush{#1}}

1. Have you looked at the cals table module?

2. Can you provide a example for your problem?

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: embedding ConTeXt code in an xtable
  2013-06-15 17:42 ` Wolfgang Schuster
@ 2013-06-16 15:05   ` Sander Maijers
  2013-06-16 18:40     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Sander Maijers @ 2013-06-16 15:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 15-06-13 19:42, Wolfgang Schuster wrote:
>
> Am 15.06.2013 um 18:01 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:
>
>> I am now using xtable to have an XMLish document to store a table. How I can embed ConTeXt code like $\Delta{}N_{\text{test}}$
>> in the external XML file file with the table? In other words, having mathematical notiation in the table header?
>>
>> I tried various things such as:
>> \expanded{\xmlflush{#1}}
>
> 1. Have you looked at the cals table module?

No. I was able to find some references to CALS and ConTeXt with Google, 
but no documentation for the module you describe.

> 2. Can you provide a example for your problem?

No, not at this time, because I am very pressed for time now. But I will 
come back to this later.

> Wolfgang
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: embedding ConTeXt code in an xtable
  2013-06-16 15:05   ` Sander Maijers
@ 2013-06-16 18:40     ` Wolfgang Schuster
  2013-06-17 20:58       ` Sander Maijers
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2013-06-16 18:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 16.06.2013 um 17:05 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:

> On 15-06-13 19:42, Wolfgang Schuster wrote:
>> 
>> Am 15.06.2013 um 18:01 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:
>> 
>>> I am now using xtable to have an XMLish document to store a table. How I can embed ConTeXt code like $\Delta{}N_{\text{test}}$
>>> in the external XML file file with the table? In other words, having mathematical notiation in the table header?
>>> 
>>> I tried various things such as:
>>> \expanded{\xmlflush{#1}}
>> 
>> 1. Have you looked at the cals table module?
> 
> No. I was able to find some references to CALS and ConTeXt with Google, but no documentation for the module you describe.

A simple example I found online:

\usemodule[cals]

\starttext

\startbuffer
<cals:table>
   <tgroup cols="1">
      <colspec/>
      <thead>
         <row>
            <entry>Any text</entry>
         </row>
      </thead>
      <tbody>
         <row>
            <entry>Any text</entry>
         </row>
      </tbody>
   </tgroup>
</cals:table>
\stopbuffer

\processXMLbuffer

\stoptext

>> 2. Can you provide a example for your problem?
> 
> No, not at this time, because I am very pressed for time now. But I will come back to this later.

When the content of the cells is normal context code you can use \xmlflushcontext instead of \xmlflush.

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: embedding ConTeXt code in an xtable
  2013-06-16 18:40     ` Wolfgang Schuster
@ 2013-06-17 20:58       ` Sander Maijers
  0 siblings, 0 replies; 5+ messages in thread
From: Sander Maijers @ 2013-06-17 20:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 16-06-13 20:40, Wolfgang Schuster wrote:
>
> Am 16.06.2013 um 17:05 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:
>
>> On 15-06-13 19:42, Wolfgang Schuster wrote:
>>>
>>> Am 15.06.2013 um 18:01 schrieb Sander Maijers <S.N.Maijers@student.ru.nl>:
>>>
>>>> I am now using xtable to have an XMLish document to store a table. How I can embed ConTeXt code like $\Delta{}N_{\text{test}}$
>>>> in the external XML file file with the table? In other words, having mathematical notiation in the table header?
>>>>
>>>> I tried various things such as:
>>>> \expanded{\xmlflush{#1}}
>>>
>>> 1. Have you looked at the cals table module?
>>
>> No. I was able to find some references to CALS and ConTeXt with Google, but no documentation for the module you describe.
>
> A simple example I found online:
>
> \usemodule[cals]
>
> \starttext
>
> \startbuffer
> <cals:table>
>     <tgroup cols="1">
>        <colspec/>
>        <thead>
>           <row>
>              <entry>Any text</entry>
>           </row>
>        </thead>
>        <tbody>
>           <row>
>              <entry>Any text</entry>
>           </row>
>        </tbody>
>     </tgroup>
> </cals:table>
> \stopbuffer
>
> \processXMLbuffer
>
> \stoptext

Are there advantages for CALS tables in ConTeXt vs. the xtable solution? 
I have R scripts (a programming language) that produce HTML tables and 
write them to files. Not very robust or complete but it works. This is 
easy to use with xtables and \xmlprocessfile . But I am interested in a 
more well-defined format such as CALS tables, of course. Anything I can 
also easily embed in DocBook documents would be very nice.

>>> 2. Can you provide a example for your problem?
>>
>> No, not at this time, because I am very pressed for time now. But I will come back to this later.
>
> When the content of the cells is normal context code you can use \xmlflushcontext instead of \xmlflush.

Thank you. Do you know of a quick way to map an attribute, say the "id" 
of the "table" element to a ConTeXt ID/name? (So that I can refer to the 
table with \in.) At the moment there are no table numbers/descriptions 
for xtables at all in my document. I am using this code based on Thomas 
Schmitz's example in the xtables manual:

     \startxmlsetups xml:testsetups
         \xmlsetsetup{main}{TABLE|TR|TD|TH}{xml:*}
     \stopxmlsetups
     \xmlregistersetup{xml:testsetups}

     \startxmlsetups xml:TABLE
         \startembeddedxtable[\xmlatt{#1}{id}]
             \xmlflush{#1}
         \stopembeddedxtable
     \stopxmlsetups

     \startxmlsetups xml:TR
         \startxrow
             \xmlflush{#1}
         \stopxrow
     \stopxmlsetups

     \startxmlsetups xml:TD
         \startxcell
             \xmlflush{#1}
         \stopxcell
     \stopxmlsetups

     \startxmlsetups xml:TH
         \startxcell[background=color,backgroundcolor=gray]
             \xmlflushcontext{#1}
         \stopxcell
     \stopxmlsetups

> Wolfgang
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-17 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-15 16:01 embedding ConTeXt code in an xtable Sander Maijers
2013-06-15 17:42 ` Wolfgang Schuster
2013-06-16 15:05   ` Sander Maijers
2013-06-16 18:40     ` Wolfgang Schuster
2013-06-17 20:58       ` Sander Maijers

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).