Difference between revisions of "Command/ getbuffer"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \<i>getbuffer</i>")
 
(Add example for combining buffers)
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<?xml version='1.0'?>
 
<!-- this file was generated on 2020-08-20T09:05 -->
 
 
<cd:commandgroup generated="yes" name="getbuffer" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
 
<cd:commandgroup generated="yes" name="getbuffer" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>
+
<cd:shortdesc><!-- a short command summary goes here -->
<!-- a short command summary goes here -->
+
The instances of  <tt>\get<i>buffer</i></tt> are used for typesetting named buffer class contents.
The instances of  <tt>\<i>getbuffer</i></tt> are used for ...
 
 
</cd:shortdesc>
 
</cd:shortdesc>
 
<cd:sequence>
 
<cd:sequence>
Line 14: Line 11:
 
   </cd:command>
 
   </cd:command>
 
</cd:variants>
 
</cd:variants>
<cd:description>
+
<cd:description>Fetches the content of a buffer class defined by {{cmd|definebuffer}} to be typeset.
<!-- the long description of the command goes here -->
 
 
</cd:description>
 
</cd:description>
<cd:examples>
+
<cd:examples><cd:example title="Combine buffers">One can combine buffers:
<!--  command example(s)
+
 
<cd:example title="">
+
+  : nothing in between
</cd:example>
+
++  : space in between
-->
+
+++ : empty line in between
</cd:examples>
+
 
<cd:notes>
+
<texcode>
<!--  this is for special remarks that do not fit elsewhere, like discovered bugs in specific context versions
+
\startbuffer[test]
<cd:note author="..." date="...">
+
    test
</cd:note>
+
\stopbuffer
-->
+
 
</cd:notes>
+
\startbuffer[oeps]
 +
    oeps
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * + test]
 +
    prepend
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = test + *]
 +
    append
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * +++ test]
 +
    before
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = test +++ *]
 +
    after
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * + oeps + test + oeps + * ]
 +
    DONE
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
</texcode>
 +
 
 +
<context>
 +
\startbuffer[test]
 +
    test
 +
\stopbuffer
 +
 
 +
\startbuffer[oeps]
 +
    oeps
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * + test]
 +
    prepend
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = test + *]
 +
    append
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * +++ test]
 +
    before
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = test +++ *]
 +
    after
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
 
 +
\startbuffer[test = * + oeps + test + oeps + * ]
 +
    DONE
 +
\stopbuffer
 +
 
 +
\typebuffer[test] \getbuffer[test]
 +
</context></cd:example></cd:examples>
 +
<cd:notes></cd:notes>
 
<cd:seealso>
 
<cd:seealso>
<!-- one or more of these:
 
<cd:commandref name="xx"></cd:commandref>
 
<cd:wikipage  page="xx"></cd:wikipage>
 
<cd:url        url="https://xx"></cd:url>
 
<cd:manual    pdf="xx"></cd:manual>
 
<cd:source    file="xx"></cd:source>
 
-->
 
 
<cd:commandref name="_startbuffer" originator="system"></cd:commandref>
 
<cd:commandref name="_startbuffer" originator="system"></cd:commandref>
 
<cd:commandref name="_typebuffer" originator="system"></cd:commandref>
 
<cd:commandref name="_typebuffer" originator="system"></cd:commandref>
 
<cd:commandref name="definebuffer" originator="system"></cd:commandref>
 
<cd:commandref name="definebuffer" originator="system"></cd:commandref>
 
<cd:commandref name="setupbuffer" originator="system"></cd:commandref>
 
<cd:commandref name="setupbuffer" originator="system"></cd:commandref>
<cd:source file="buff-ini.mkiv" originator="system"></cd:source>  
+
<cd:source file="buff-ini.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Buffer"></cd:wikipage>  
+
<cd:wikipage originator="system" page="Category:Buffer"></cd:wikipage></cd:seealso>
</cd:seealso>
 
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 17:09, 18 December 2021


\getbuffer

Summary

The instances of \getbuffer are used for typesetting named buffer class contents.

Description

Fetches the content of a buffer class defined by \definebuffer to be typeset.

Examples

Combine buffers

One can combine buffers:

+ : nothing in between ++ : space in between +++ : empty line in between

\startbuffer[test]
    test
\stopbuffer

\startbuffer[oeps]
    oeps
\stopbuffer

\typebuffer[test] \getbuffer[test]

\startbuffer[test = * + test]
    prepend
\stopbuffer

\typebuffer[test] \getbuffer[test]

\startbuffer[test = test + *]
    append
\stopbuffer

\typebuffer[test] \getbuffer[test]

\startbuffer[test = * +++ test]
    before
\stopbuffer

\typebuffer[test] \getbuffer[test]

\startbuffer[test = test +++ *]
    after
\stopbuffer

\typebuffer[test] \getbuffer[test]

\startbuffer[test = * + oeps + test + oeps + * ]
    DONE
\stopbuffer

\typebuffer[test] \getbuffer[test]

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: