Command/useblocks
From ConTeXt wiki
< Command
\useblocks
Syntax
| \useblocks[...,...,...][...,...,...] | |
| [...,...,...] | names of block classes to reuse here |
| [...,...,...] | tags (optional) |
Description
\useblocks[myquestion,myanswer] typesets all myquestion and myanswer blocks defined in the document, in the order in which they were defined. An optional second argument can be used to print only blocks with certain tags.
Example
\defineblock[myquestion] \defineblock[myanswer] % We don't want to display blocks when we define them. \hideblocks[myquestion,myanswer] \starttext \beginmyquestion[first] First question, defined at the start \endmyquestion \beginmyanswer[first] First answer \endmyanswer \subsection{My questions and answers, original interleaving} \useblocks[myquestion,myanswer] \subsection{Only the first answer} \useblocks[myanswer][first] \beginmyquestion Second block, defined at the end \endmyquestion \beginmyanswer Second answer, also defined at the end \endmyanswer \stoptext
This gives:
See also
- \defineblock to define a new kind of block.
- \setupblock to set up block style.
- \keepblocks to start displaying blocks where they are defined.
- \hideblocks to stop displaying blocks where they are defined.
- \useblocks to display blocks.
- \selectblocks to display only blocks mentioned in the current section.
- \processblocks to process blocks without printing them.
- \forceblocks
- \nomoreblocks to allow one-pass compilation under certain conditions.
Help from ConTeXt-Mailinglist/Forum
All issues with: