Difference between revisions of "Command/setupblock"

From Wiki
Jump to navigation Jump to search
m (cleanup)
 
(11 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
}}
 
}}
  
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupblock</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
Line 14: Line 16:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:before|before]]</td>
+
     <td class="cmd">[[Command/keyword:before|before]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>''command'' to place before each block, e.g. {{cmd|startnarrower}}</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:after|after]]</td>
+
     <td class="cmd">[[Command/keyword:after|after]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>''command'' to place after each block, e.g. <code>\stopnarrower</code></td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:inner|inner]]</td>
+
     <td class="cmd">[[Command/keyword:inner|inner]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>''command'' to perform in each block</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:style|style]]</td>
+
     <td class="cmd">[[Command/keyword:style|style]]</td>
     <td>[[Reference/en/value:normal|normal]] [[Reference/en/value:bold|bold]] [[Reference/en/value:slanted|slanted]] [[Reference/en/value:boldslanted|boldslanted]] [[Reference/en/value:type|type]] [[Reference/en/value:cap|cap]] [[Reference/en/value:small...|small...]] [[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:file|file]]</td>
+
     <td class="cmd">[[Command/keyword:file|file]]</td>
     <td>[[Reference/en/value:file|file]] </td>
+
     <td>''file'' in which to look for the blocks when displaying them.</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
 +
== Description ==
 +
Setup how blocks are displayed.
 +
 +
== Example ==
 +
<context source=yes text="This gives:">
 +
\defineblock[question]
 +
\keepblocks[question] % We want to display blocks where we define them.
 +
\setupbackground[background=color, color=red]
  
== Description ==
+
\subject{List of questions}
 +
 
 +
\beginquestion
 +
    How much wood would a woodchuck chuck if a woodchuck could chuck wood?
 +
\endquestion
  
 +
\subject{The questions again}
  
 +
\setupblock[question][
 +
    %% if we had a file my_questions.tex containing \beginquestions, we would use:
 +
    % file=my_questions,  % (works only under mkii?)
 +
    before=\startbackground,
 +
    after=\stopbackground,
 +
    inner=\margintitle{again}
 +
]
  
== Example ==
+
\useblocks[question]
<!-- 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 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|setupblock]]
+
[[Category:Command/Blocks|setupblock]]

Latest revision as of 13:24, 13 October 2019

\setupblock

Syntax (autogenerated)

\setupblock[...,...][...=...,...]
[...,...]name
beforecommand
aftercommand
leftcommand
rightcommand
alternativeparagraph text
innercommand
setupsname
alignsee \setupalign
stylestyle command
colorcolor


Syntax

\setupblock[...,...,...][...,...=...,...]
[...,...,...] name
before command to place before each block, e.g. \startnarrower
after command to place after each block, e.g. \stopnarrower
inner command to perform in each block
style normal bold slanted boldslanted type cap small... command
file file in which to look for the blocks when displaying them.

Description

Setup how blocks are displayed.

Example

\defineblock[question]
\keepblocks[question] % We want to display blocks where we define them.
\setupbackground[background=color, color=red]

\subject{List of questions}

\beginquestion
    How much wood would a woodchuck chuck if a woodchuck could chuck wood?
\endquestion

\subject{The questions again}

\setupblock[question][
    %% if we had a file my_questions.tex containing \beginquestions, we would use:
    % file=my_questions,  % (works only under mkii?)
    before=\startbackground,
    after=\stopbackground,
    inner=\margintitle{again}
]

\useblocks[question]

This gives:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: