Difference between revisions of "Command/ getbuffer"
< Command
Jump to navigation
Jump to search
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<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><!-- a short command summary goes here --> | <cd:shortdesc><!-- a short command summary goes here --> | ||
− | The instances of <tt>\get<i>buffer</i></tt> are used for | + | The instances of <tt>\get<i>buffer</i></tt> are used for typesetting named buffer class contents. |
</cd:shortdesc> | </cd:shortdesc> | ||
<cd:sequence> | <cd:sequence> | ||
Line 11: | 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. |
</cd:description> | </cd:description> | ||
− | <cd:examples></cd:examples> | + | <cd:examples><cd:example title="Combine buffers">One can combine buffers: |
+ | |||
+ | + : nothing in between | ||
+ | ++ : space in between | ||
+ | +++ : empty line in between | ||
+ | |||
+ | <texcode> | ||
+ | \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] | ||
+ | </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:notes></cd:notes> | ||
<cd:seealso> | <cd:seealso> |
Latest revision as of 16:27, 14 April 2024
Contents
\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]