Difference between revisions of "Command/processblocks"

From Wiki
Jump to navigation Jump to search
Line 68: Line 68:
 
<cd:commandref name="hideblocks">to stop 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="useblocks">to display blocks.</cd:commandref>
<cd:commandref name="selectblocks">to display only blocks mentioned in the current section.</cd:commandref></cd:seealso>
+
<cd:commandref name="selectblocks">to display only blocks mentioned in the current section.</cd:commandref>
 +
<cd:commandref name="processblocks">to process blocks without printing them.</cd:commandref>
 +
<cd:commandref name="forceblocks"></cd:commandref>
 +
<cd:commandref name="nomoreblocks"></cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 15:15, 18 November 2021


\processblocks

Summary

The command \processblocks is used to process blocks

Settings

\processblocks[...,...][...,...][...=...,...]
[...,...]name
[...,...]name
criteriumtext section

Description

Print only the blocks with tag, but process them all. This is important when enumerations are in play, because items that are not processed don't increment the counter. If no tags are specified, all the blocks are printed.


Examples

Example 1

\starttext
\defineblock[question]
\defineenumeration[Q][text=Q]

\subject{These are the questions}

\beginquestion[first]
\Q This should be number 1
\endquestion

\beginquestion[last]
\Q This should be number 2
\endquestion

\subject{Useblocks only processes the blocks you ask for}

(Reset the \type{question} counter)
\resetQ

\useblocks[question][last]

\subject{Processblocks prints the blocks you ask for, but processes them all}

(Reset the \type{question} counter.)
\resetQ

\processblocks[question][last]

\stoptext

gives

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: