Difference between revisions of "Command/selectblocks"

From ConTeXt wiki
Jump to navigationJump to search
(Description, example, category.)
(Get rid of some whitespace in the code.)
Line 34: Line 34:
  
 
\starttext
 
\starttext
 +
 
\section{A to B}
 
\section{A to B}
 
 
\beginmyblock
 
\beginmyblock
 
A is for Amy, who fell down the stairs.
 
A is for Amy, who fell down the stairs.
 
\endmyblock
 
\endmyblock
 
 
\beginmyblock
 
\beginmyblock
 
B is for Basil, assaulted by bears.
 
B is for Basil, assaulted by bears.
Line 45: Line 44:
  
 
\selectblocks[myblock][criterium=section]
 
\selectblocks[myblock][criterium=section]
 +
  
 
\section{C to D}
 
\section{C to D}
 
 
\selectblocks[myblock][criterium=section]
 
\selectblocks[myblock][criterium=section]
  
Line 53: Line 52:
 
C is for Claire, who wasted away.
 
C is for Claire, who wasted away.
 
\endmyblock
 
\endmyblock
 
 
\beginmyblock
 
\beginmyblock
 
D is for Desmond, thrown out of the sleigh.
 
D is for Desmond, thrown out of the sleigh.

Revision as of 14:13, 24 April 2012

\selectblocks

Syntax

\selectblocks[...,...,...][...,...,...][...=...]
[...,...,...] block
[...,...,...] tag
criterium all section


Description

Like \useblocks, prints blocks of type block tagged with tag; but you can add an argument [criterium=section] to print only blocks defined in the current section. If the tags argument is missing, all blocks of type block are printed.


Example

\defineblock[myblock]
\hideblocks[myblock]

\starttext

\section{A to B}
\beginmyblock
A is for Amy, who fell down the stairs.
\endmyblock
\beginmyblock
B is for Basil, assaulted by bears.
\endmyblock

\selectblocks[myblock][criterium=section]


\section{C to D}
\selectblocks[myblock][criterium=section]

\beginmyblock
C is for Claire, who wasted away.
\endmyblock
\beginmyblock
D is for Desmond, thrown out of the sleigh.
\endmyblock

\section{All everything}
\selectblocks[myblock]

\stoptext

This gives:

See also


Help from ConTeXt-Mailinglist/Forum

All issues with: