Hi Roger,

Firstly: drafts are indeed the way to go. \completelistoffigures
places a complete list of figure *captions*, so that takes care of
that.

% No need to define a mode: you can simply enable it with
% \enablemode[draft]
% or
% context --mode=draft
\enablemode[draft]

\startmode[draft]
\completelistoffigures
\stopmode

Figure images, unlike figure captions, are not saved to a list. A
pity, as this makes it difficult to get the associated figure image
given a figure number (or figure label). I would do this:
(1) make it so you can call the figure image with
\externalfigure[img:fig:mylabel]. Use \useexternalfigure for this.
(2) then label the figure with [fig:mylabel]
(3) then simply manually make an entry in the figures section for each
figure label.

Perhaps some ConTeXt user more familiar with lists can provide a
better, list-based, solution?

\useexternalfigure[img:fig:pointy graph][pointy-graph.png]

\placefigure
    [here]
    [fig:pointy graph]
    {caption of the pointy graph}
    {\externalfigure[img:fig:pointy graph][width=4cm]}

\startmode[draft]
\section{Just the figures}

\in{Figure}[fig:pointy graph]
\externalfigure[img:fig:pointy graph]

\stopmode

If you want to automate this, you'll want something like this.
Untested and probably needs debugging first, but the table names are
correct:

\startluacode
-- we won't need the keys k, but still.
for k,v in pairs(structures.lists.ordered.float.figure) do
  label_string = v.references.reference
  -- `..` is Lua for string concatenation
  image_string = "img" .. label_string

  -- arguments to TeX commands:
  -- get [stuff] in TeX with { 'stuff' } in Lua
  -- get [stuff=bother] in TeX with { stuff = 'bother' } in Lua
  -- get {stuff} in TeX with 'stuff' in Lua
  context.in("Figure", { label_string })
  context.externalfigure( { image_string } )
end
\stopluacode

I have made this reply long because I lack the time to make it short.

Cheers,
Sietse
___________________________________________________________________________________
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 via email to