Difference between revisions of "Command/selectblocks"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \selectblocks")
 
Line 28: Line 28:
 
</cd:description>
 
</cd:description>
 
<cd:examples><cd:example title=""><context source="yes" text="This gives:">
 
<cd:examples><cd:example title=""><context source="yes" text="This gives:">
 +
\setuppapersize[A7]
 
\defineblock[myblock]
 
\defineblock[myblock]
 
\hideblocks[myblock]
 
\hideblocks[myblock]
Line 66: Line 67:
 
<cd:commandref name="defineblock">to define a new kind of block.</cd:commandref>
 
<cd:commandref name="defineblock">to define a new kind of block.</cd:commandref>
 
<cd:commandref name="setupblock">to set up block style.</cd:commandref>
 
<cd:commandref name="setupblock">to set up block style.</cd:commandref>
<cd:commandref name="keepblocks">to start displaying blocks where they are defined.</cd:commandref></cd:seealso>
+
<cd:commandref name="keepblocks">to start displaying blocks where they are defined.</cd:commandref>
 +
<cd:commandref name="hideblocks">to stop displaying blocks where they are defined.</cd:commandref>
 +
<cd:commandref name="useblocks">to display blocks.</cd:commandref>
 +
<cd:commandref name="processblocks">to process blocks without printing them.</cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 15:28, 18 November 2021


\selectblocks

Summary

The command \selectblocks is used for printing blocks

Settings

\selectblocks[...,...][...,...][...=...,...]
[...,...]name
[...,...]name
criteriumtext 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.


Examples

Example 1

\setuppapersize[A7]
\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:

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: