Changes

Jump to navigation Jump to search
2,224 bytes added ,  17:44, 6 September 2020
Created page with "Documentation for \startbuffer ... \stopbuffer"
<cd:commandgroup name="buffer" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
The environment <tt>\startbuffer ... \stopbuffer</tt> is used for temporarily storing content.
</cd:shortdesc>
<cd:variants>
<cd:command category="buffer" file="buff-ini.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-buffer.xml" level="document" name="buffer" type="environment" variantnumber="1">
<cd:arguments>
<cd:keywords optional="yes" ordinal="1">
<cd:keywordsdoc>You can give a name to the buffer if you want.</cd:keywordsdoc>
<cd:constant type="cd:name"></cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>You can store information temporarily for future use in your document with:

<texcode>
\startbuffer[visit]
If you want to see what Hasselt has in store you should come and visit it
some time.
\stopbuffer
\getbuffer[visit]
</texcode>

With

<texcode>
\getbuffer[visit]
</texcode>
you recall the stored text. The logical name is optional. With

<texcode>
\typebuffer[visit]
</texcode>
you get back the verbatim contents of the buffer, typeset as though inside <code>\starttyping...\stoptyping</code>.

Buffers are set up with:

<texcode>
\setupbuffer[..,..=..,..]
</texcode>

You can also create your own named buffers as an instance of {{gen|startbuffer}} by using {{cmd|definebuffer}}.

Note that the default {{cmd|startbuffer}} is not an instance of {{gen|startbuffer}}; it has its own (equivalent) definition.
</cd:description>
<cd:examples><cd:example title=""><context source="yes">
\startbuffer[buffer-name]
Text...
\stopbuffer

\getbuffer[buffer-name] % insert content of \startbuffer ... \stopbuffer

\typebuffer[buffer-name] % type content in verbatim mode
</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="buff-ini.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Buffer"></cd:wikipage>
<cd:commandref name="_startbuffer"></cd:commandref>
<cd:commandref name="definebuffer"></cd:commandref>
<cd:commandref name="setupbuffer"></cd:commandref></cd:seealso>
</cd:commandgroup>

Navigation menu