ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Adam Lindsay" <atl@comp.lancs.ac.uk>
Subject: Re: ConTeXt and DocBook - beginner's questions
Date: Fri, 25 Feb 2005 17:43:04 +0000	[thread overview]
Message-ID: <20050225174304.24661@mail.comp.lancs.ac.uk> (raw)
In-Reply-To: <E1D4iTz-0006NI-GX@iglou.com>

phthenry@iglou.com said this at Fri, 25 Feb 2005 11:38:27 -0500:

>> Hans began that with ContML, a simplified XML structure for basic
>> documents, mirroring familiar ConTeXt commands (take a look at the x-
>> contml.tex source). He enabled a lot more with the tricks features in
>> This Way #9 (the magazine link).
>
>Sorry to be dense, but I can't find this. Could you give me a link? It 
>looks like ContML is just for math?

Well, x-contml.tex is in the ConTeXt source tree. (Often we'll talk about
filenames like x-contml, type-exa, and m-layout on the list. They have an
implied .tex extension and are (almost) all found in your updated TeX
tree, in tex/context/base.)

You can have an XML document/fragment like:
<context:text>
 <context:section>A Sample Document</context:section>
 <context:include name="knuth" type="tex"/>
 <context:subsection>Something deeper</context:subsection>
 <context:p>Some text with <context:em>emphasis</context:em> and
  <context:type>some</context:type> other 
  <context:b>style</context:b>.
  <context:itemize type="n">
   <context:item>Oh look, a list</context:item>
   <context:item>With three items, which</context:item>
   <context:item>Hardly seems worth the effort.</context:item>
  </context:itemize>
 </context:p>
</context:text>


and run it with:
 texexec --pdf --use=contml filename.xml

So ContML is not just about math at all.
For (XML) math, you want to go to the MathML modules, which are in the
xtag-mm* ConTeXt files.

The interesting things come when you use mappings akin to the ones here:
 <http://www.pragma-ade.com/show-mag-9.htm>
and my stuff that I plugged earlier. Not only can you use XML for
structural markup, but (with a little work) you can use it for simple
style configuration, like this in front of a document similar to the above:

<config:setupwhitespace dimension="big"/>
<config:definetypeface name="charter"/>
<config:definetypeface family="sans" name="helvetica" rscale="0.91"/>
<config:setupbodyfont size="12pt"/>
<config:setuphead label="section" style="tfb" alternative="inmargin"/>
<config:setuphead label="subsection" style="ita" alternative="inmargin"/>
<config:setuplayout label="preset-2-2" columns="8"/>
<config:enablelayout label="preset-2-2"/>
<context:articleheader title="On ContML" author="Adam T. Lindsay"
date="February 25, 2005"/>

This will look *very* familiar to ConTeXt users, and some of them might
even find this syntax easier to remember than with some of ConTeXt's commands.

One of the key ideas to take away from ConTeXt's XML manual <http://
www.pragma-ade.com/show-man-15.htm> is that there are *many* different
paths to take when processing XML. You can now take a 100% XML path with
XSL-FO, now, but that misses out on so much of ConTeXt's excellent
capabilities.

Hope that helps,
adam
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  reply	other threads:[~2005-02-25 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-25 10:34 Radoslaw Moszczynski
2005-02-25 14:17 ` phthenry
2005-02-25 14:48   ` Adam Lindsay
2005-02-25 16:38     ` phthenry
2005-02-25 17:43       ` Adam Lindsay [this message]
2005-02-25 21:32         ` Paul Tremblay
2005-02-25 23:25           ` Adam Lindsay
2005-02-27 19:44             ` h h extern

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=20050225174304.24661@mail.comp.lancs.ac.uk \
    --to=atl@comp.lancs.ac.uk \
    --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).