Difference between revisions of "Command/setbuffer"

From Wiki
Jump to navigation Jump to search
 
Line 12: Line 12:
 
   </cd:command>
 
   </cd:command>
 
</cd:variants>
 
</cd:variants>
<cd:description>This command is very much like {{cmd|setbuffer}} except it takes a less careful (more low-level) approach to collecting the content. It also does not pay attention to the {{cmd|setupbuffer|2=[strip=yes]}} setting; multiple spaces are always collapsed into a single space. Because of this, it is practically useless when {{cmd|typebuffer}} will be used.
+
<cd:description>This command is very much like {{cmd|startbuffer}} except it takes a less careful (more low-level) approach to collecting the content. It does not pay attention to the {{cmd|setupbuffer|2=[strip=yes]}} setting; multiple spaces are always collapsed into a single space. Because of this, it is practically useless when {{cmd|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 {{cmd|startbuffer}}.
+
But if the buffer content is fairly well-behaved, must only be typeset, and speed is of the essence, then this is a useful alternative to {{cmd|startbuffer}}.
 
</cd:description>
 
</cd:description>
 
<cd:examples><cd:example title=""><context source="yes">
 
<cd:examples><cd:example title=""><context source="yes">

Latest revision as of 18:14, 6 September 2020


\setbuffer ... \endbuffer

Summary

The environment \setbuffer ... \endbuffer is used for filling a buffer.

Settings

\setbuffer[...] ... \endbuffer
[...]name

Description

This command is very much like \startbuffer except it takes a less careful (more low-level) approach to collecting the content. It 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.

But if the buffer content 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]

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: