Difference between revisions of "Command/keepblocks"

From Wiki
Jump to navigation Jump to search
(Description, example, category)
m
Line 21: Line 21:
  
 
== Description ==  
 
== Description ==  
From here on, typeset blocks where they are defined, as well as when recalled. This is on by default in Mk II, and off by default in Mk IV.
+
From here on typeset blocks where they are defined, as well as when they are recalled. This is on by default in mkii, and off by default in mkiv.
  
  
 
== Example ==
 
== Example ==
<context source=yes text=gives>
+
<context source=yes text="This gives:">
 
\starttext
 
\starttext
  
 
\defineblock[myblock]
 
\defineblock[myblock]
 
  
 
\section{Defining blocks}
 
\section{Defining blocks}
Line 59: Line 58:
 
* {{cmd|keepblocks}} to start displaying blocks where they are defined.
 
* {{cmd|keepblocks}} to start displaying blocks where they are defined.
 
* {{cmd|hideblocks}} to stop displaying blocks where they are defined.
 
* {{cmd|hideblocks}} to stop displaying blocks where they are defined.
* {{cmd|useblocks}} to display blocks.
+
* {{cmd|useblocks}} to display previously defined blocks.
 
* {{cmd|selectblocks}} to display only blocks mentioned in the current section.
 
* {{cmd|selectblocks}} to display only blocks mentioned in the current section.
 
* {{cmd|processblocks}} to process blocks without printing them.
 
* {{cmd|processblocks}} to process blocks without printing them.

Revision as of 14:40, 24 April 2012

\keepblocks

Syntax

\keepblocks[...,...,...][...,...,...]
[...,...,...] names of block classes (defined with \defineblock)
[...,...,...] tags to keep, or keyword all


Description

From here on typeset blocks where they are defined, as well as when they are recalled. This is on by default in mkii, and off by default in mkiv.


Example

\starttext

\defineblock[myblock]

\section{Defining blocks}

\beginmyblock
In Mk II, blocks are kept by default; in Mk IV, blocks are hidden by default.
\endmyblock

\hideblocks[myblock]
\beginmyblock
Potato (first, hidden where defined)
\endmyblock

\keepblocks[myblock]

\beginmyblock
Tomato (second, shown where defined)
\endmyblock

\section{Recalling blocks}
\useblocks[myblock]

\stoptext

This gives:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: