Difference between revisions of "Command/setbuffer"
< Command
Jump to navigation
Jump to search
(Created page with "Documentation for \setbuffer ... \endbuffer") |
|||
Line 18: | Line 18: | ||
<cd:examples><cd:example title=""><context source="yes"> | <cd:examples><cd:example title=""><context source="yes"> | ||
− | \setupbuffer[strip=yes] | + | \setupbuffer[strip=yes] |
\setbuffer[mybuf] | \setbuffer[mybuf] | ||
Line 25: | Line 25: | ||
\endbuffer | \endbuffer | ||
+ | Setbuffer: | ||
\getbuffer[mybuf] | \getbuffer[mybuf] | ||
\typebuffer[mybuf] | \typebuffer[mybuf] | ||
Line 33: | Line 34: | ||
\stopbuffer | \stopbuffer | ||
+ | Startbuffer: | ||
\getbuffer[mybuf] | \getbuffer[mybuf] | ||
\typebuffer[mybuf] | \typebuffer[mybuf] | ||
Line 43: | Line 45: | ||
<cd:commandref name="startbuffer"></cd:commandref> | <cd:commandref name="startbuffer"></cd:commandref> | ||
<cd:commandref name="typebuffer"></cd:commandref> | <cd:commandref name="typebuffer"></cd:commandref> | ||
− | <cd:commandref name="getbuffer"></cd:commandref></cd:seealso> | + | <cd:commandref name="getbuffer"></cd:commandref> |
+ | <cd:commandref name="setupbuffer"></cd:commandref></cd:seealso> | ||
</cd:commandgroup> | </cd:commandgroup> |
Revision as of 18:14, 6 September 2020
Contents
\setbuffer ... \endbuffer
Summary
The environment \setbuffer ... \endbuffer is used for filling a buffer.
Settings
Description
This command is very much like \setbuffer except it takes a less careful (more low-level) approach to collecting the content. It also does not pay attention to the \setupbuffer[strip=yes] setting; multiple spaces are always collapsed into a single space. Because of this, it is practically useless when \typebuffer will be used.
If the buffer is fairly well-behaved, must only be typeset, and speed is of the essence, then this is a useful alternative to \startbuffer.
Examples
Example 1
\setupbuffer[strip=yes] \setbuffer[mybuf] Some buffered text extra line \endbuffer Setbuffer: \getbuffer[mybuf] \typebuffer[mybuf] \startbuffer[mybuf] Some buffered text extra line \stopbuffer Startbuffer: \getbuffer[mybuf] \typebuffer[mybuf]