From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: referring to floats in xml
Date: Sun, 20 Mar 2011 12:05:24 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.01.1103201203310.18474@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <123216F8-B630-4FB5-AF30-0A3A4CE3BC79@hccnet.nl>
On Sun, 20 Mar 2011, R. Ermers wrote:
> Dear All,
>
> My xml docbook file contains a number of graphics. Some are regular
> figures, some are edgefigures. I have two questions in this respect.
Understanding these snippets is difficult without a minimal working
example.
> A. referring to floats
>
> \placeedgefigure
> [\xmlatt{#1}{id}]
> {\xmlfirst{#1}{/caption}}
> {\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject}}}}
>
> \definefloat[edgefigure][figure]
> \setupfloat[edgefigure]
> [leftmargindistance=-\innercombitotal,rightmargindistance=-\outercombitotal,
> default={outer,low,long}, criterium=.65\textwidth,numbering=no]
>
> <mediaobject id="fig:cow" role="edgefigure">
> <imageobject>
> <imagedata scale="500" fileref="cow.jpg"/>
> </imageobject>
> </mediaobject>
>
> I now wonder how to refer to these floats. That is, referring through <xref linkend="cow"/> is not difficult to implement, but for some reason the mapping of the id is not that obvious. I tried it like this:
>
> \startxmlsetups xml:mediaobject:edgefigure
> \placeedgefigure
> [\xmlatt{#1}{id}]
> {\xmlfirst{#1}{/caption}}
> {\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject}}}}
> \stopxmlsetups
Try
\placeedgefigure
[]
[\xmlatt{#1}{id}]
{....}
{....}
> B. edgefigures and regular figures
>
> The document contains two types of figures.
>
> \xmlsetsetup{#1}{mediaobject[@role='fig']}{xml:mediaobject:fig}
> \xmlsetsetup{#1}{mediaobject[@role='edgefigure']}{xml:mediaobject:edgefigure}
>
> I have noticed that when <mediaobject> contains both the attributes id
> and role, such as the cow example, the figure is considered a regular
> figure automatically and will not typeset as an edgefigure.
Please provide a minimal working example.
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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-03-20 16:05 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 [this message]
2011-03-21 6:28 ` R. Ermers
2011-03-21 15:44 ` Aditya Mahajan
2011-03-22 7:42 ` 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.1103201203310.18474@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).