ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: cals tables - UNSOLVED
Date: Fri, 18 Mar 2011 00:08:32 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.01.1103180002260.8409@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <8EE590AC-597D-454A-BED3-A69ADF17E388@hccnet.nl>

On Thu, 17 Mar 2011, R. Ermers wrote:

> Dear All,
>
> I am still trying to typeset cals tables.
>
> I have
> 1. an environment document with instructions.
> 2. an xml docbook file containing cals tables
>
> Note that the original cals tables (docbook standard) use <table, <tgroup, etc. but for ConTeXt purposes this  - as far as I understand - needs to be: <cals:table, <cals:tgroup, etc. (My xml reader does not recognize them anymore.)


There is a bug in lxml-dir.lua. Open lxml-dir.lua and change

local collection = xml.applylpath({ getid(xml.load(filename)) },"directive") -- is { } needed ?

to

local collection = xml.applylpath(getid(xml.load(filename)),"directive") 
-- AM: removed { }

[@Hans: I do not checked if this affects other uses of 
directives.load(...).]

Then run c --make to regenerate formats. After that create three files:

%% directives.xml
<?xml version="1.0" standalone="yes"?>
<directives>
   <directive attribute="cdx" value="color" element="cals:table"
              setup="cdx:cals:table:colors"/>
</directives>


%% table.xml
<?xml version="1.0" standalone="yes"?>

<cals:table cdx="color">
   <cals:tgroup cols="3">
     <cals:thead>
       <cals:row>
         <cals:entry>alpha</cals:entry>
         <cals:entry>beta</cals:entry>
         <cals:entry>gamma</cals:entry>
       </cals:row>
     </cals:thead>
     <cals:tbody>
       <cals:row>
         <cals:entry>one</cals:entry>
         <cals:entry>two</cals:entry>
         <cals:entry>three</cals:entry>
       </cals:row>
       <cals:row>
         <cals:entry>four</cals:entry>
         <cals:entry>five</cals:entry>
         <cals:entry>six</cals:entry>
       </cals:row>
     </cals:tbody>
   </cals:tgroup>
</cals:table>


%% test.tex
\usemodule[cals]

\startsetups cdx:cals:table:colors
   \setupTABLE[each][each][background=color,backgroundcolor=red]
\stopsetups

\starttext
\xmlloaddirectives{directives.xml}
\xmlprocess{xml:cals:process}{table.xml}{}
\stoptext


Then compile test.tex to get a table with a red background.

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


  reply	other threads:[~2011-03-18  4:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 11:26 cals tables R. Ermers
2011-03-07 11:41 ` Hans Hagen
2011-03-07 12:41   ` R. Ermers
2011-03-07 21:10     ` R. Ermers
2011-03-08 20:00   ` R. Ermers
2011-03-09 13:30     ` Hans Hagen
2011-03-11  8:35       ` R. Ermers
2011-03-12 11:46         ` R. Ermers
2011-03-17 10:33           ` cals tables - UNSOLVED R. Ermers
2011-03-18  4:08             ` Aditya Mahajan [this message]
2011-03-18  7:47               ` R. Ermers
2011-03-19  8:10                 ` R. Ermers

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=alpine.LNX.2.01.1103180002260.8409@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --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).