I'm hoping to find an easy solution to this problem.

I want to install the American Economic Association document class and use it in Lyx. I have inserted the class file into the right latex directory and run texhash. Next I created a simple layout file, played it in the layout folder, and reconfigured Lyx. Now, American Economic Association (AEA) appears in my dropdown menu as a document class option in class under the articles heading, but when I try to use the file, it tells me that there is a problem with the layout file.

I suspect that I have no found the correct layout folder. The layout folder I'm using is empty except for the file I added. Is this normal? I can't find, for example, the article.layout file. I should say that Lyx appears to be working normally otherwise. I have no problem compiling normal files.

I'm on a Macbook Pro running OSX Yosemite. The directory I have been using for layout files is /Users/amandaggregg/Library/Application Support/LyX-2.1/layouts, which Lyx preferences indicate should be the right folder.

I know about http://www.troubleshooters.com/linux/lyx/surefire_layout.htm, but it looks complicated and time-consuming. Hoping to find an easier solution.

Looking forward to your responses

  • If you go to File > New From Template, and open AEA.lyx, can you compile it? LyX comes with an AEA layout file. You could search for ".layout" files on your computer: locate ".layout". LyX has two layout directories, one in the installation directory (in lib/layout) and one in your user directory.
    – scottkosty
    Apr 1 '15 at 15:15
  • Thank you, this worked. I deleted the layout file I made, reconfigured Lyx, and used File > New From Template. Works like a charm. Thank you!
    – Amanda G
    Apr 1 '15 at 16:28
  • For posterity, I located the layout files in /Applications/LyX.app/Contents/Resources/layouts/ using the locate ".layout" command as you suggested.
    – Amanda G
    Apr 1 '15 at 16:32

Layout Folders

There are generally two folders, where LyX searches for .layout files: A system-wide folder (for all users, usually one needs root privileges to alter this) and a user-specific folder in the users home. It depends on your operating system, where exactly these are located. The directories listed in Preferences->Paths are a good starting point.

Document-Local Layout

However, in most cases it is easier (and preferable) to store the custom .layout file together with the respective LyX-Document (that is, in the same folder as the .lyx file). Then select this by clicking the Local Layout... button under Document Settings->Document Class.

  • Which of the 10 paths in the preferences dialog is searched for system layouts?
    – Autumn
    Dec 19 '18 at 1:07
  • 1
    @DSJustice: Strangely enough, none. In the preferences you can only configure use-specific paths.
    – Daniel
    Dec 19 '18 at 11:56

Try running "Tools > Reconfigure". (I had the same problem and this worked for me.)

  • Please, can you complete your little answer, also with the images, more explantions,....?
    – Sebastiano
    May 1 '20 at 10:54

On Manjaro Linux 21.0.7, with LyX installed from the official repositories (extra/lyx), the paths are configured by default this way:

Preferences view of LyX, showing Working Directory set to $HOME

with "Working directory" set to $HOME. In $HOME, I have a .lyx folder, which has a layouts folder where you can put the .layout file. It looks like this:

❯ tree -L 2 -l .lyx
├── bbxFiles.lst
├── bibFiles.lst
├── bind
├── bstFiles.lst
├── cache
│   ├── 1917147396-png
│   └── index
├── cbxFiles.lst
├── clipart
├── clsFiles.lst
├── configure.log
├── doc
├── examples
├── images
├── kbd
├── layouts
│   └── exam.layout
├── lyxciteengines.lst
├── lyxmodules.lst
├── lyxrc.defaults
├── packages.lst
├── scripts
├── session
├── styFiles.lst
├── templates
├── textclass.lst
├── ui
└── xtemplates.lst

You can see the exam.layout file I was trying to install. After placing it in the layouts folder, do Tools > Reconfigure inside LyX and then restart LyX, and it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.