Difference between revisions of "Command/definestartstop"

From Wiki
Jump to navigation Jump to search
m (cleanup)
(Example reworked)
Line 38: Line 38:
 
Example: Long Quotations
 
Example: Long Quotations
  
<texcode>
+
<context source="yes">
 
\defineblank[ExtractDistance][3pt]
 
\defineblank[ExtractDistance][3pt]
 
\definestartstop[Extract][
 
\definestartstop[Extract][
Line 49: Line 49:
 
       \blank[ExtractDistance]
 
       \blank[ExtractDistance]
 
       \indenting[next]}]
 
       \indenting[next]}]
</texcode>
+
%Now the following commands are available: \startExtract and \stopExtract
  
Then the following commands are available: <tt>\startExtract</tt> and <tt>\stopExtract</tt>
+
\starttext
 +
The extract from D.Knuth
 +
\startExtract \input knuth \stopExtract
 +
\stoptext
 +
</context>
  
 
== See also ==
 
== See also ==

Revision as of 19:21, 18 April 2010

\definestartstop

Syntax

\definestartstop[...][...,...=...,...]
[...] name
before command
after command
style normal bold slanted boldslanted type cap small ... command
commands command


Description

Used to define block level commands.

Example

Example: Long Quotations

\defineblank[ExtractDistance][3pt]
\definestartstop[Extract][
   style=slanted,
   before={\blank[ExtractDistance]
      \setupnarrower[left=1.5pc,right=1.5pc]
      \startnarrower[left,right]
      \noindent},
   after={\stopnarrower
      \blank[ExtractDistance]
      \indenting[next]}]
%Now the following commands are available: \startExtract and \stopExtract

\starttext
The extract from D.Knuth
\startExtract \input knuth \stopExtract
\stoptext

See also