On Sunday 09 March 2008 16:09, Steve Litt wrote:
> On Sunday 09 March 2008 15:35, Steve Litt wrote:
> > Hi all,
> >
> > I just lost my entire book structure due to a small modification to my
> > layout file that prevented compilation. LyX therefore reverted the book's
> > document class from my custom "rjustbook" to "article", removing all
> > chapters and flattening out the table of contents.
>
> I reenstated all the chapters, which had been converted to body text. It
> appears like none of my custom character styles were zapped, but my custom
> environments were, so I'll need to figure out how to find them all, and
> reenstate them to the custom styles instead of the reverted body text.
>
> Once again, if there's a way to warn the user that their custom
> environments will be reverted, and give them the opportunity to save before
> reversions.
First of all, do as I say, not as I do. Back up several times per day :-)
If you ever need to did yourself out of one of these environment reversions,
and if you have a reasonably recent version that has not experienced
environment reversion, you can find all environments used in the old document
like this:
grep "begin_layout" mybook_old.lyx | sort -u
The preceding gives a list of all environments used in the old document.
Remove all article-provided environments -- those did not revert, presumably.
What you're left with is environments that reverted.
Now, in a read only text editor, search the old document for each of those
environments, and obtain some suitable search text with which to look for the
same text in the new (but reverted) version. Apply the proper environment in
the new one.
The preceding is the fastest recovery you can make, but it's ugly. The way out
of this is to back up several times per day.
SteveT
Steve Litt
Books written in LyX:
Troubleshooting Techniques of the Successful Technologist
Twenty Eight Tales of Troubleshooting
Troubleshooting: Just the Facts