On Tuesday 29 April 2008 09:00, you wrote:
> Steve Litt wrote:

> > My LyX file keeps reverting to a blank document class. I have a feeling
> > it's something in my \frontmatter, but can't be sure. Basically, any time
> > I do anything involving Document->settings, my custom document class goes
> > away.
>
> This puzzles me. Your document class shouldn't change unless (a) you
> select a new class or (b) the document class is one that is unknown to
> LyX. But of course (b) shouldn't happen except when you open the
> document, and (a) isn't something likely to happen accidentally unless
> you're doing something with accelerators.

I've had a little sleep now so perhaps I can think better. I believe I had 
been editing my layout file when it first happened.
>
> But I've done a little experimenting, and here's one way this can
> happen. First, you have to be using a "local" layout file, that is, a
> layout file that is not in your LyX user directory but instead in the
> directory with the source file. 

I'm using a layout file in the source file directory. However, there's a 
symlink to a the same name in /home/slitt/.lyx/layouts.

However, around that time I was editing TWO DIFFERENT documents using that 
same layout -- one tiny one with just the front matter in order to fine-tune 
my front matter, and one with incomplete front matter but a whole 11 chapters 
plus appendix. I needed to work with the small file to eliminate 12 second 
compiles. In addition, I was editing another document that used a different 
layout and resided in a different directory. The purpose was that it was a 
completed, perfectly formatted book from which I could copy, and then paste 
to my new book. I'm not sure, but I think the current directory while editing 
the completed book might have been the directory housing the NEW book. I 
tried very hard, and I think succeeded, from saving the completed book. The 
errors I found were on the new book.

One more thing that might provide a hint. At least some of the times I 
observed this automatic switching away from my custom document class, when I 
scanned the list of available document classes to "put it back", my custom 
document class was listed twice in the document class. This document class 
switching is intermittent, and while I can't say for sure a correspondence 
between it appearing twice and it evaporating, I cannot remember a time it 
disappeared when it was not listed twice, and I cannot remember a time when 
it did not disappear when it was listed twice.

> Second, you have to "Save as..." to some 
> other directory. If you then open Document>Settings, all will seem well
> until you hit OK (or Apply), at which point...
>
> > There's a little warning, but nothing that says DANGER, YOUR SOURCE FILE
> > HAS JUST LOST EVERY CUSTOM ENVIRONMENT AS WELL AS CHAPTERS, AND IF YOU
> > SAVE IT IT WILL COST YOU HOURS OF WORK. IF AT ALL POSSIBLE, ABORT THIS
> > LYX SESSION WITHOUT SAVING AND RESUME FROM A BACKUP!!!!!
>
> ...you'll get the warning: Using default document class because class
> YourLocalLayout is unknown. But you should also get a window labeled
> Parse Errors, showing you the dozens of layouts that have changed. (You
> can even click on these, and you'll be taken to them.) I don't know if
> that is what is causing your problem, but it is a bug, to be sure.

I got the parse errors, but IIRC I didn't get any other errror message.

>
> Are you using a local layout? etc? 

Yes, but there's a symlink name to it in /home/slitt/.lyx/layouts.

> Is that the error you are getting? 
> Are you getting the Parse Errors window?

I got the parse error window. There were about 8 cryptic errors.

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/

Reply via email to