Difference between revisions of "Command/typesetbuffer"

From ConTeXt wiki
(initial command wiki page)
 
Line 15: Line 15:
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[...,...=...,...]</td>
 
     <td class="cmd">[...,...=...,...]</td>
    <td>see [[Command/useexternalfigure|\useexternalfigure]] </td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 26: Line 25:
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
 
  
<context mode="mkiv" source="yes" text="produces">
+
<texcode mode="mkiv">
 
\starttext
 
\starttext
  
Line 42: Line 40:
 
     \typesetbuffer[sample][frame=on,page=2]
 
     \typesetbuffer[sample][frame=on,page=2]
 
     \typesetbuffer[sample][frame=on,page=3]
 
     \typesetbuffer[sample][frame=on,page=3]
 
    % \externalfigure[\lasttypesetbuffer][frame=on,page=2]
 
 
    % \typesetbuffer[*][frame=on,page=3]
 
  
 
\stoptext
 
\stoptext

Revision as of 12:06, 10 August 2013

\typesetbuffer

Syntax

\typesetbuffer[buffer]
[buffer] name of the buffer (optionally * refers to the last typeset buffer)
[...,...=...,...]

Description

With \typesetbuffer[mybuffer], ConTeXt typesets the buffer mybuffer (previously defined by command \startbuffer) as an independent file and it includes it in the document as an external image.

To get back the verbatim content of the buffer use the command \typebuffer. And to get the buffer typeset as part of your document (no external processing and inclusion as external figure) use \getbuffer.

Example

<texcode mode="mkiv"> \starttext

    \startbuffer [sample]
        \starttext
            \startTEXpage[offset=10pt] one   \stopTEXpage
            \startTEXpage[offset=10pt] two   \stopTEXpage
            \startTEXpage[offset=10pt] three \stopTEXpage
        \stoptext
    \stopbuffer
    \typesetbuffer[sample][frame=on,page=1]
    \typesetbuffer[sample][frame=on,page=2]
    \typesetbuffer[sample][frame=on,page=3]

\stoptext </context>

From version 2013.08.09, when you invoke \typesetbuffer on a buffer already typeset, the buffer won’t be typeset again, but the requested page(s) will be included in the document as external figures. (Both commented commands from sample implement the same functionality.)

See also

  • \input - Include the complete content of a text file.
  • \startbuffer - Define the content of a temporary buffer.
  • \typebuffer - Get back the content of a buffer as verbatim text.
  • \getbuffer - Get back the formatted content of a buffer.

Help from ConTeXt-Mailinglist/Forum

All issues with: