Command/useblocks

From ConTeXt wiki
Jump to: navigation, search

\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

Help from ConTeXt-Mailinglist/Forum

All issues with:

C O N T E X T G A R D E N

Personal tools
Namespaces
Variants
Actions
Help
External Help
Installation
Navigation
Toolbox