Difference between revisions of "Command/definedelimitedtext"

From Wiki
Jump to navigation Jump to search
m (Correct syntax synopsis)
(More complete example, syntax synopsis)
Line 7: Line 7:
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
   <tr>
 
   <tr>
     <td colspan="2" class="cmd">\definedelimitedtext<span class="first" >[...]</span><span class="second" style="color:red;">[...]</span></td>
+
     <td colspan="2" class="cmd">\definedelimitedtext
 +
      <span class="first" >[...]</span>
 +
      <span class="second" style="color:red;">[...]</span>
 +
      <span class="third" style="color:red;">[...,...=...,...]</span>
 +
  </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
Line 16: Line 20:
 
     <td class="cmd" style="color:red">[...]</td>
 
     <td class="cmd" style="color:red">[...]</td>
 
     <td>''delimitedtext to inherit from''</td>
 
     <td>''delimitedtext to inherit from''</td>
 +
  </tr>
 +
  <tr valign="top" class="third">
 +
    <td class="cmd" style="color:red">[...,...=...,...]</td>
 +
    <td>see {{cmd|setupdelimitedtext}}</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 26: Line 34:
 
== Example ==
 
== Example ==
  
<context source="yes">
+
<context mode=mkiv source="yes">
% Narrower output, please
+
% mode=mkiv
\setuppapersize[A5]
+
 
 +
\setuppapersize[A6]
 +
 
 +
Here come the delimited texts!
 +
 
 +
\setupquotation[color=red]
 +
\startquotation
 +
    Plain quotation
 +
\stopquotation
  
% We'll be wanting a 3-point distance between the quotation and the text before it
+
% Definition inherits, followed by setting up
\defineblank[extractdistance][3pt]
+
\definedelimitedtext[qone][quotation]
 +
\setupdelimitedtext[qone][left=«]
  
% Define a new \startextract environment
+
\startqone
\definedelimitedtext[extract][blockquote]
+
    Inheritance followed by setup
 +
\stopqone
  
% Set up the new \startextract environment
+
% Definition inherits and sets up all in one step
\setupdelimitedtext
+
\definedelimitedtext[qtwo][quotation][right=»]
  [extract]
+
\startqtwo
  [spacebefore=extractdistance,
+
     Inheritance simultaneous with setup
     leftmargin=1.5pc,
+
\stopqtwo
    before={\setupindenting[next]}
 
  ]
 
  
\starttext
+
The last form does not work in the MkIV on the wiki (\contextversionnumber),  
    \quotation{Under Milk Wood} opens as follows:
+
but it works with ConTeXt 201200419 23:18 MkIV.
    \startextract
 
        To begin at the beginning: It is spring, moonless night in the small town,
 
        starless and bible-black, the cobblestreets silent and the hunched,  
 
        courters'-and-rabbits' wood limping invisible down to the sloeblack, slow,
 
        black, crowblack, fishingboatbobbing sea.
 
    \stopextract
 
\stoptext
 
 
</context>
 
</context>
  

Revision as of 16:14, 24 May 2012

\definedelimitedtext

Syntax

\definedelimitedtext
     [...]
     [...]
     [...,...=...,...]
[...] name
[...] delimitedtext to inherit from
[...,...=...,...] see \setupdelimitedtext


Description

Define a new kind of delimited text (usually a quotation or blockquote) with an associated style.

Example

% mode=mkiv

\setuppapersize[A6]

Here come the delimited texts!

\setupquotation[color=red]
\startquotation
    Plain quotation
\stopquotation

% Definition inherits, followed by setting up
\definedelimitedtext[qone][quotation]
\setupdelimitedtext[qone][left=«]

\startqone
    Inheritance followed by setup
\stopqone

% Definition inherits and sets up all in one step
\definedelimitedtext[qtwo][quotation][right=»]
\startqtwo
    Inheritance simultaneous with setup
\stopqtwo

The last form does not work in the MkIV on the wiki (\contextversionnumber), 
but it works with ConTeXt 201200419 23:18 MkIV.

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: