On Thursday 11 September 2008 11:51:59 am Steve Litt wrote:
> Hi all,
>
> It seems to me that from the dawn of time (2001 for me), getting LyX to
> work with a layout file anywhere but /home/myuid/.lyx/layouts was extremely
> difficult, with no reproducible procedure. You'd create a symlink from
> where the file really existed to /home/myuid/.lyx/layouts, and then after
> about an hour of fiddling around, the document class would somehow
> magically show up in your list.
>
> It got even worse in 1.5.x when they attempted to recognize layout files in
> the current directory. You could have duplicate copies with all sorts of
> environment-munching disasters, or none, or who knows what.
>
> Yesterday I got a layout file to work the first time. What a refreshing
> difference. Here's what I did:
>
> cd /home/myuid/mybook
> Decided my document class should be called infacebook
> Created a small layout file as infacebook_layout.src
> ln -s /home/myuid/mybook/infacebook_layout.src
> /home/myuid/.lyx/layouts/infacebook.layout lyx/reconfigure
> lyx mybook.lyx
> switch document class to infacebook, which is now listed.
>
> The key here is that the actual physical file (as opposed to the symlink
> name) does not end with .layout, so LyX doesn't try to use it as a layout
> file. LyX relies only on the symlink copy in /home/myuid/.lyx/layouts.
>
> HTH
>
> SteveT

I should add a couple things:

Before opening mybook.lyx with infacebook document class, you should make a 
brand new document, which can be empty, and set that empty document to 
infacebook document class. If that doesn't work, suspect your layout file has 
errors and fix them.

If necessary, start with this trivial known good layout file to eliminate the 
possibility of your layout source being bad:

================================================
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[book]{trivialbook}

Input stdclass.inc
#Format 2
Input book.layout

Preamble
EndPreamble

Style TrivItemize
        CopyStyle Itemize
End
================================================

Of course, you must call this file ./trivialbook_layout.src and follow all the 
symlinking/reconfigure steps in order for it to work. The point is, there's 
now a way to quickly put your layout source code into any directory you want, 
and have it quickly recognized by LyX.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US

Reply via email to