Difference between revisions of "Command/keepblocks"

From Wiki
Jump to navigation Jump to search
m (cleanup)
 
(12 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
}}
 
}}
  
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>keepblocks</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
Line 11: Line 13:
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[...,...,...]</td>
 
     <td class="cmd">[...,...,...]</td>
     <td>name </td>
+
     <td>''names of block classes (defined with \defineblock)''</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[...,...,...]</td>
 
     <td class="cmd">[...,...,...]</td>
     <td>all name </td>
+
     <td>''tags to keep, or keyword'' all</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
 +
== Description ==
 +
From here on typeset blocks where they are defined, as well as when they are recalled. This is on by default in mkii, and off by default in mkiv.
 +
 +
== Example ==
 +
<context source=yes text="This gives:">
 +
\starttext
 +
 +
\defineblock[myblock]
 +
 +
\section{Defining blocks}
 +
 +
\beginmyblock
 +
In Mk II, blocks are kept by default; in Mk IV, blocks are hidden by default.
 +
\endmyblock
  
== Description ==
+
\hideblocks[myblock]
 +
\beginmyblock
 +
Potato (first, hidden where defined)
 +
\endmyblock
 +
 
 +
\keepblocks[myblock]
  
 +
\beginmyblock
 +
Tomato (second, shown where defined)
 +
\endmyblock
  
 +
\section{Recalling blocks}
 +
\useblocks[myblock]
  
== Example ==
+
\stoptext
<!-- Please fill in an example if you can -->
+
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* {{cmd|defineblock}} to define a new kind of block.
 +
* {{cmd|setupblock}} to set up block style.
 +
* {{cmd|keepblocks}} to start displaying blocks where they are defined.
 +
* {{cmd|hideblocks}} to stop displaying blocks where they are defined.
 +
* {{cmd|useblocks}} to display previously defined blocks.
 +
* {{cmd|selectblocks}} to display only blocks mentioned in the current section.
 +
* {{cmd|processblocks}} to process blocks without printing them.
 +
* {{cmd|forceblocks}}
 +
* {{cmd|nomoreblocks}} to allow one-pass compilation under certain conditions.
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Reference/en|keepblocks]]
+
[[Category:Command/Blocks|keepblocks]]

Latest revision as of 13:24, 13 October 2019

\keepblocks

Syntax (autogenerated)

\keepblocks[...,...][...,...]
[...,...]name
[...,...]name


Syntax

\keepblocks[...,...,...][...,...,...]
[...,...,...] names of block classes (defined with \defineblock)
[...,...,...] tags to keep, or keyword all

Description

From here on typeset blocks where they are defined, as well as when they are recalled. This is on by default in mkii, and off by default in mkiv.

Example

\starttext

\defineblock[myblock]

\section{Defining blocks}

\beginmyblock
In Mk II, blocks are kept by default; in Mk IV, blocks are hidden by default.
\endmyblock

\hideblocks[myblock]
\beginmyblock
Potato (first, hidden where defined)
\endmyblock

\keepblocks[myblock]

\beginmyblock
Tomato (second, shown where defined)
\endmyblock

\section{Recalling blocks}
\useblocks[myblock]

\stoptext

This gives:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: