f



Writing contents of an external file to another external file?

Hi,

I'm currently working with the ledmac package that I've modified
somewhat to meet my needs. Ledmac is used to create critical endnotes
and (in somewhat simplified terms) it writes the endnote info into an
external file (called \jobname.end) and when a \doendnotes{X} command
is called, it closes that file and places an \input{\jobname.end} into
the root document. I have created also another file (called
\jobname.eaa) in which similar sort or endnote info is written.

The problem is that I would like to periodically, first, write _the
contents_ of \jobname.eaa into \jobname.end (and then empty .eaa to
receive more info, which works ok): essentially to have a command that
periodically "dumps" the contents of .eaa file to the .end file. Ho
could I do this? I have tried many things and searched this group, as
well as a few (La)TeX books but, alas, to no avail.

I can of course simply make the package to periodically write
"\include{\jobname.eaa}" into the .end file, but this is not
desirable, since I don't want the entire, final .eaa file written to
those places, just the contents the .eaa file has _accumulated until_
I  give the command to write itself into .end.

I have been thinking about a TeXnique to somehow save, or create
placeholder tokens for the endnote info that now goes into the .eaa
file and then just periodically collate and \immediate\write those
tokens to the .end file, but I'm not at all sure how to do this.

Thank you for any answers or comments.

0
10/16/2007 7:06:56 PM
comp.text.tex 39027 articles. 3 followers. Post Follow

2 Replies
914 Views

Similar Articles

[PageSpeed] 58

Sorry to continue on my own post, but one option would be to establish
a \newcounter to append a number to the name of the \jobname.eaa files
and then write "\input{\jobname[counter value].eaa}" to the .end file.

In the project that I use the package with, with this mechanism would
eventually be probably well over a hundred of such .eaa files. Will
this be a problem? Furthermore how could I make the \counter _number_
to appear in the filename? Would a simple \the suffice?

Again, sorry, and thank you for any insights!


0
10/16/2007 7:15:39 PM
ludvikengelbrekt@yahoo.co.uk wrote:

> The problem is that I would like to periodically, first, write _the
> contents_ of \jobname.eaa into \jobname.end (and then empty .eaa to
> receive more info, which works ok): essentially to have a command that
> periodically "dumps" the contents of .eaa file to the .end file. Ho
> could I do this? I have tried many things and searched this group, as
> well as a few (La)TeX books but, alas, to no avail.

Have a look at the \verbatimcopy-macro of the
verbatimcopy-package maintained by Lars Madsen:
http://www.ctan.org/tex-archive/macros/latex/contrib/verbatimcopy/

You may wish to write to a register other than \verbatim@out
while opening and closing this write-handle outside the 
\verbatimcopy-macro.

Ulrich


0
eu_angelion1 (617)
10/17/2007 12:57:30 AM
Reply: