Difference between revisions of "Command/typesetbuffer"

From ConTeXt wiki
(add options)
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
   <tr>
 
   <tr>
     <td colspan="2" class="cmd">\typesetbuffer<span class="first" style="color:red;">[buffer]</span></td>
+
     <td colspan="2" class="cmd">\typesetbuffer<span class="first">[buffer]</span><span class="second">[...,...=...,...]</span></td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
Line 14: Line 14:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[...,...=...,...]</td>
+
     <td class="cmd">{{key|page}}</td>
 +
    <td class="cmd">number</td>
 +
  </tr>
 +
  <tr valign="top" class="second">
 +
    <td class="cmd">{{key|frame}}</td>
 +
    <td>'''on''' off none overlay</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 +
 +
Other options of {{cmd|framed}} (see {{cmd|setupframed}}) should also work.
  
 
== Description ==
 
== Description ==
Line 26: Line 33:
 
== Example ==
 
== Example ==
  
<texcode mode="mkiv">
+
<context mode="mkiv" source="yes" text="produces">
\starttext
+
\startTEXpage
  
 
     \startbuffer [sample]
 
     \startbuffer [sample]
Line 37: Line 44:
 
     \stopbuffer
 
     \stopbuffer
  
     \typesetbuffer[sample][frame=on,page=1]
+
     one: \typesetbuffer[sample][frame=on,page=1]
     \typesetbuffer[sample][frame=on,page=2]
+
 
    \typesetbuffer[sample][frame=on,page=3]
+
     two: \externalfigure[\lasttypesetbuffer][frame=on,page=2]
 +
 +
    three: \typesetbuffer[*][frame=on,page=3]
  
\stoptext
+
\stopTEXpage
 
</context>
 
</context>
  
From version 2013.08.09, when you invoke {{cmd|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.)
+
From version 2013.08.09, when you invoke {{cmd|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.
  
 
== See also ==
 
== See also ==

Latest revision as of 14:41, 27 July 2018

\typesetbuffer

Syntax

\typesetbuffer[buffer][...,...=...,...]
[buffer] name of the buffer (optionally * refers to the last typeset buffer)
page number
frame on off none overlay

Other options of \framed (see \setupframed) should also work.

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

\startTEXpage

     \startbuffer [sample]
         \starttext
             \startTEXpage[offset=10pt] one   \stopTEXpage
             \startTEXpage[offset=10pt] two   \stopTEXpage
             \startTEXpage[offset=10pt] three \stopTEXpage
         \stoptext
     \stopbuffer

     one: \typesetbuffer[sample][frame=on,page=1]

     two: \externalfigure[\lasttypesetbuffer][frame=on,page=2]
 
    three: \typesetbuffer[*][frame=on,page=3]

\stopTEXpage

produces

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.

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: