From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: latest beta - Math error
Date: Tue, 3 Mar 2009 12:48:33 +0100 [thread overview]
Message-ID: <11F26402-6856-4E41-BBA4-D99912C7E2AC@gmail.com> (raw)
In-Reply-To: <49AD1338.1050708@wxs.nl>
Am 03.03.2009 um 12:23 schrieb Hans Hagen:
>> A ConTeXt version of the filecontents for LaTeX would be handy in
>> such cases.
>
> i have no clue what this means
Thomas was unable to show his problem with a buffer, the filecontents
environment is like a buffer but writes the content to a file with
a given name, e.g.
<test.tex>
\begin{filecontentents}{example.xml}
<?xml version="1.0" encoding="utf-8"?>
<auth>
<section><content>Hello <</content></section>
</auth>
\end{filecontents}
...
\starttext
\xmlprocess{main}{example.xml}{}
\stoptext
</test.tex>
Everything between \begin/end{filecontents} is written to the file
example.xml.
This is handy for example given on the list because attatchments are a
problem
in the mail archive and you have to create only one tex file for the
example.
Here is a example but it works only on MkII.
\unprotect
\def\startfilecontents
{\bgroup
\protectbuffersfalse
\dosingleargument\dostartfilecontents}
\def\dostartfilecontents[#1]%
{\beforesplitstring#1\at.\to\filename
\aftersplitstring #1\at.\to\extension
\let\f!temporaryextension\extension
\dostartbuffer[\filename][startfilecontents][stopfilecontents]}
\def\stopfilecontents
{\doifdefined{savebuffer}{\savebuffer[\filename]}\egroup}
\protect
\startfilecontents[a1.txt]
1 5
2 4
3 8
4 9
8 8
\stopfilecontents
\starttext
\readfile{a1.txt}{}{}
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2009-03-03 11:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-02 21:32 Thomas A. Schmitz
2009-03-02 22:32 ` Hans Hagen
2009-03-02 22:39 ` Thomas A. Schmitz
2009-03-03 8:09 ` Hans Hagen
2009-03-03 8:29 ` Taco Hoekwater
2009-03-03 10:44 ` Thomas A. Schmitz
2009-03-03 11:07 ` Wolfgang Schuster
2009-03-03 11:23 ` Hans Hagen
2009-03-03 11:48 ` Wolfgang Schuster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11F26402-6856-4E41-BBA4-D99912C7E2AC@gmail.com \
--to=schuster.wolfgang@googlemail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).