2007/3/12, Wolfgang Schuster <schuster.wolfgang@googlemail.com>:


2007/3/11, Steffen Fritzsche <fritzsche@scriptroom.de>:
hi,

I'm currently writing my diploma thesis with context. I already read the
wiki and searched the manuals but I didn't find something like a common
practice for defining new caption types.

My problem: I have a lot of code listings and I want to define a custom
caption type (named listing) and aggregate them into a own register. I
already set up a new register with

\defineregister [listing][Listing]

and it is also possible to place listings in this register with

\placelisting{
       \startJV
               ...
       \stopJV
}

but how can I add a custom caption to this listing? I'm thinking of
something like \placefigure. Or perhaps I must just setup placelisting.
Any Idea? Thanks in advance!

Steffen
 
Hi Steffen,
 
\definefloat[listing][listings]
 
 
you can change the caption text with the following command
 
\setuplabeltext[listing=captiontext ]      % works for all languages
\setuplabeltext[de][listing=captiontext ] % works only the german caption
 
\starttext
 
\placelistoflistings
%\completelistoflistings
 
\placelistings
  {text}
  {\startJV
   ...
   \stopJV}
 
this should be
 
\placelisting
  {text}
   \bgroup
   \startJV
   ...
   \stopJV
   \egroup
 
\stoptext
 

Wolfgang