Changes

Jump to navigation Jump to search
455 bytes added ,  14:18, 8 June 2020
m
no edit summary
Basically, to embed text in your document (tex input file) which is written to an external document when you process it, you can use buffers:
 
<texcode>
\startbuffer[x]
x
\stopbuffer
 
\savebuffer[x][temp.log]
</texcode>
 
The second argument is optional and when omitted the buffer will be saved as <code>jobname-<buffername>.tmp</code>.
 
 
----
Written in 2010
 
LaTeX provides a <code>filecontent</code> environment to embed text in your document
which is written to a an external document when your you process it. The filename is given with
the argument for the environment.
You could define a an environment for the same effect with the buffer mechanism, the codefor such a an environment is:
<texcode>
\definemessageconstant {filecontents}
\startmessages startinterface all library: \setinterfacemessage{filecontents }{title: }{filecontents} \setinterfacemessage{filecontents}{1: } {Overwriting file --} \setinterfacemessage{filecontents}{2: } {Writing file --}\stopmessagesstopinterface
\def\startfilecontents
\stopfilecontents
</texcode>
 
[[Category:Tools]]

Navigation menu