ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "R. Ermers" <r.ermers@hccnet.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: referring to floats in xml
Date: Tue, 22 Mar 2011 08:42:55 +0100	[thread overview]
Message-ID: <A9B9B88C-E1C4-46CE-8841-B0A6B0FE2199@hccnet.nl> (raw)
In-Reply-To: <alpine.LNX.2.01.1103211134220.5784@ybpnyubfg.ybpnyqbznva>

Thanks very much, Aditya for your advice. I really appreciate it. 
I tried your suggestions.

> On Mon, 21 Mar 2011, R. Ermers wrote:
> 
>> Thanks, Aditya, The first problem is adequately solved by adding []. I'll prepare an example for the second problem.
>> 
>> A related problem is referring to sections and other blocks.
>> 
>> <section id="sec:cows"><title>Cows</title>
>> <para>cows cows cows. As I told in <xref linkend="sec:cows"/></para></section>
>> 
>> The title is mapped as follows (lpath):
>> \xmlsetsetup{#1}{section/title}{xml:section/title}
>> 
>> \startxmlsetups xml:section:title
>> \section{\xmlflush{#1}}
>> \stopxmlsetups
>> 
>> The section is not mapped:
>> \startxmlsetups xml:section
>> \xmlflush{#1}
>> \stopxmlsetups
>> 
>> Adding [\xmlatt{#1}{id}] to xml:section:title does not work of course. 
>> Using [\xmlatt{#1}{id}] with xml:section puts the id before the \section 
>> command. I think one of the other commands has to be used in such a way 
>> that the id is flushed forward after the \section command.
> 
> Map section to include both id and title. (Untested)
> 
> \startxmlsetups xml:section
> \section[\xmlatt{#1}{id}]{\xmlfirst{#1}{/title}}
> % or slightly better
> % \section[\xmlattdef{#1}{id}{+}]{\xmlfirst{#1}{/title}}
The section titles and numbers are doubled now, most likely due to other mappings that. The subsection and subsubsection titles need to be mapped as such, a generic mapping for all section heads is not feasible (I think).

> % Then flush para separately
> % \xmlall{#1}{/para}

This does not work, because the sections contain all kinds of elements, not just <para>. 
<section><blockquote/><section><para>text</para></section><para>text</para></section>

I tried \xmlall{#1} with other elements, but the result is a mess. I need an lpath symbol that refers to all underlying elements. I tried {+}, {*}, {//}, etc.

> % or
> % \xmlconcat {#1} {/para} {\par}
> % or better, add a contents tag around the contents
> % <section> <title> ... </title>
> %   <contents> ... </contents>

> % </section>
> % and then use
> % \xmlfirst{#1}{/contents}
> 

I had thought about this, but it would ruin the docbook structure of the document, and my editor programme would no longer accept it. The programme already complains about the change of <table to <cals:table. The typesetting of tables as part of the document is still a problem ...

> \stopxmlsetups
> 
> 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-22  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-20  9:46 R. Ermers
2011-03-20 16:05 ` Aditya Mahajan
2011-03-21  6:28   ` R. Ermers
2011-03-21 15:44     ` Aditya Mahajan
2011-03-22  7:42       ` R. Ermers [this message]

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=A9B9B88C-E1C4-46CE-8841-B0A6B0FE2199@hccnet.nl \
    --to=r.ermers@hccnet.nl \
    --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).