Helge Hafting wrote:
On Wed, May 05, 2004 at 09:46:12AM +0200, Georg Baum wrote:
5) Fix the real problem behind: double data definition. Define a newThis is very useful, see below.
format for included lyx files that is identical to the normal one but
without the header information (similar to latex). Currently lyx tries to
pretend that files made for inclusion are also usable without the master
file.
Only as long as there is no better solution.
An having unprintable include-book, include-report, include-letter and so on is a better solution?
Not a problem, see below.This might work sometimes, but not in general (imagine the case that the master file has a new command defined in the preamble that is used in the included document).
It is. You don't know wether the subdocument can be compiled at all,
Yes, I often know that. The subdocument isn't necessarily planned as such, it could very well be a standalone document with some content I want included in something larger.
even if it can be compiled, you don't know wether the output is the same as
in the master document (think of \renew... stuff in the preamble).
Using latex in the preamble is the users responsibility. And nothing whatsoever in the preamble is a very common case, it applies to every non-expert or latex-ignorant user.
Want to use more latex packages? Add support for them in lyx instead. :-)
Feel free to warn if there _is_ a preamble, or ideally only if the included document's preamble isn't identical to the master document preamble. If the document types match and the preambles match (or doesn't exist) then there is no problem.
If you are a careful user, and know all the possible problems, you can ensure manually that everything is ok. This might work perfectly for you, but in general I think it is better to enforce the correctness technically.
Nonexpert users doesn't put stuff in the preamble, experts knows how the preamble works. It seems to me problem you try to prevent applies to a narrow group.
Ok, copying stuff around is not a good solution.Now your'e demanding that included file must be of type "subdocument" that cannot exist on its own.
Before, the demand was that included files must be the same document class as the master, or it _might_ not work.
Either way there is a limit on what can be included, but your way
has additional restrictions. Dividing up a large document (or book)
in several parts _is_ common. Printing such a part on its own
without the master _is_ common too, so this should work!
Don't be afraid. I did not say that this not important. I also did not say that the proposed change should be implemented without a solution for the mentioned problems. Finally, I won't do any work on this in the near future.
It is not a problem when the subdocument is the same type
as the master, because any command defined in the master's preamble
is then also defined in the subdocument's preamble, so the
result is the same when the subdocument is printed on its own.
(A big project naturally gets its own document class. Smaller
cases can copy preamples around if need be.)
Copying things around does not work in practice. Been there, done that and ended up putting everything in a .tex file that is included in every preamble. Unfortunately this means also that I had to set things in .tex that are settable from within lyx (paragraph indent/skip for example).
Custom document classes have their own problems in lyx: I have to createYes, a new layout takes some work. It is useful at times though.
a .layout file, and I need to distribute it to co-workers, they have to put
it in some special place, reconfigure lyx. This problem would vanish if
the .layout files could be embedded into the .lyx file, but then we have
again the double data definition problem.
Not a problem if the documents are of the same class. They really should be, or you'll get trouble even without preambles. Chapters and sections doesn't exist in "letter", so including a book or article may fail without any preamble magic.
I have a book, where each chapter is a file. Today I can print
a single chapter and send it away for review. With your shceme
I first have to print the entire book (much slower) to find which
pages make up that chapter, then print again selecting only
those pages. (Of course this "printing" isn't on paper, I
make a pdf). And of course I might even be unable to print the
entire book at times, because a co-writer might be busy
editing some other chapter making it temporarily broken.
Of course there should be an intelligent and easy way to print only selected
parts, and this is not the only problem. As I said, there are some problems
associated with this approach, but I still think that the problems can be
solved and that it is the better solution.
I see nothing wrong in making a new feature-poor document class that can be included in anything. (Useful if you want to include something both in reports and articles, for example. And if you don't care to match the document types.) This should solve your problem. But please don't plan restrictions that hit power users just so some newbie won't get a latex error. That will happen anyway if they experiment with latex commands (ERT or preambles).
The newbie can be warned if he include a report in a book, or mix documents with mismatching preambles.
Helge Hafting