Am 18.11.2012 um 20:27 schrieb H. Özoguz <h.oezo...@mmnetz.de>:

> My question to your module: How can I customize the
> 
> \startannotation \stopannotation enovirnment,
> 
> s.t. it does not start with ", but with another symbol (or maybe without any 
> symbol)?

The annotation module let you define a command/environment to collect text
and format it in (nearly) any way you want, there is no distinction between
\command{…} and \startcommand …\stopcommand.


Copy this example and process it with context:

\usemodule[annotation]

\setuplayout
  [backspace=6cm,
   cutspace=2cm,
   width=middle]

\setupannotation[color=blue]

% one + two

\defineannotation[one][alternative=paragraph]
\defineannotation[two][alternative=text]

% three

\define[2]\ThreeCommand
  {\startframedtext[middle]
   #2
   \stopframedtext}

\defineannotation[three][alternative=command,command=\ThreeCommand]

% four

\startsetups [annotation:four]
  \startframedtext[width=broad,framecolor=red]
  \placeannotationcontent
  
\doifsomething{\annotationparameter{author}}{\wordright{\annotationparameter{author}}}
  \stopframedtext
\stopsetups

\defineannotationalternative[four][renderingsetup=annotation:four]

\defineannotation[four][alternative=four]

\starttext

\input knuth
\one{\input ward }
\input knuth
\starttwo\input ward \stoptwo
\input knuth
\three{\input ward }
\input knuth
\startfour[author=Ward]\input ward \stopfour
\input knuth

\stoptext


In the example above I define four annotation command, while the first two
use predefined alternatives the third and fourth use ones I define in the 
document.

The command “three” uses the “command” alternative which expects a command
with two parameters, the first parameter can be used to print a title with the 
content
of the “text” and “title” keys (not used in my example) and the second 
parameters
prints the content of the command/environment.

The “four” command (you could also have used \four[author=Ward]{\input ward } in
the document) uses a different approach to define a customized layout. First you
create a new alternative with \defineannotationalternative where you specify a 
setup.
The setup itself is created with \startsetups … \stopsetups where you can use
all context commands you like. Values from \setupannotation or optional 
arguments
for \four or \startfour can be accessed with \annoationparameter{<key>}.

Wolfgang
___________________________________________________________________________________
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