Difference between revisions of "Command/defineblock"

From Wiki
Jump to navigation Jump to search
m (last -> first)
m (Remove white line)
Line 11: Line 11:
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[...]</td>
 
     <td class="cmd">[...]</td>
     <td>''name''</td>
+
     <td>''name of block type''</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
Line 56: Line 55:
  
 
[[Category:Commands|defineblock]]
 
[[Category:Commands|defineblock]]
 +
td class="cmd">[...]
 
td class="cmd">[...]
 
td class="cmd">[...]

Revision as of 16:28, 24 April 2012

\defineblock

Syntax

\defineblock[...]
[...] name of block type

Description

Blocks are reusable pieces of text. Once a block type is defined with \defineblock[name], the blocks can be defined (with or without displaying them) using \beginname[tags] ... \endname. (Yes, that is \begin... and \end..., not \start... and \stop....) There are a number of commands to display all or some of the blocks defined in the document; see the See Also section for a list with descriptions.

Example

\defineblock[question]
\hideblocks[question] % We don't want to print blocks where we define them

\beginquestion[first]
To be, or not to be?
\endquestion

\section{Let's see what blocks we've got.}
\useblocks[question]

\section{We've seen what blocks we've got. Let's take another look at that first question.}
\useblocks[question][first]

\beginquestion[last]
Mais o\`u sont les neiges d'antan?
\endquestion

This gives:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

td class="cmd">[...] td class="cmd">[...]