My current plan for include files works like this:
In the main program, I loop over a filelist & translate each file.
The filelist at first contains just the file name given on the command
line.

While I'm translating a tex file, if I find a \include command (let's
worry about \input without braces later, ok?) I get the name of that file
& add it to the filelist. So when I finish translating that file, I'll go
back to the main program and get to the end brace of the while loop, only
now the filelist contains more files, so I go back to the top & translate
more files. 

The question is, what do I put into those included lyx files. I think
asger may have answered this question already, but it can't hurt to ask it
again.

Options:

(a) put in a whole lyx preamble, including both lyx options and the
latex preamble we read from the main file

(b) put in a lyx preamble including just lyx options

(c) put in *nothing*, because we're just going to use "Insert->Include
File" on those files anyway, and Insert->Include doesn't need a preamble.

I first thought the answer was (a). Then I thought it was (c). Now I think
it's (a) again. Right? It seems like you need to generate a legal lyx file
so that lyx can load it separately. And it seems like the legal definition
is that it has the first two lines ((C) matthias) and the \lyxformat, plus
a \the_end. And I guess I can't do (b) because then you'll have two copies
of the preamble. I think.

The other exciting news is that once we do this, it becomes amazingly
simple to run reLyX on latex fragments. And that means that as soon as one
of those lazy developers gets around to it, we can import latex fragments
into existing lyx files! Here, it seems (based on a couple experiments)
like we'd be allowed to generate files without even the three top lines &
the_end, but I could be wrong about that too. 

Thoughts?

-Amir

Reply via email to