On Sun, 8 Jun 2008, Steve Litt wrote:

In the 7 years I've used LyX, every book had its own layout, and every single time, I spent hours tweaking around trying to get my layout visible to the document so that I could use my specialized document class.

Hi Steve,

Just to be clear on the basic issues here so that we don't misuse the terminology. I also hope this will enlighten other readers on this list.

When you refer to the layout of the book, you mean the layout of printed copy. At the end of the day, when LaTeX is building the document, this is controlled by choosing the LaTeX document class (*.cls), using different LaTeX style files (*.sty) and generally tweaking the document's preamble.

When I want to the control the appearance of the printed copy, I usually proceed as follows:
* Select an already existing LyX document layout (*.layout)
* Modify the document settings through dialogs
* Tweak the document's LaTeX preamble by including LaTeX style files
  (*.sty) and adding some LaTeX statements.
* Insert some LaTeX code directly into the LyX document through ERT
  (Evil Red Text)

However, if I've understood you correctly, you do it slightly differently.
Instead of modifying the document to produce the desired appearance, you create a new LyX layout file (*.layout) which contains as much as possible of the LaTeX code. In other words, you make the .layout file select the correct LaTeX document class through the statement
        # \DeclareLaTeXClass...
and you use the .layout-file to insert LaTeX code into the document's preamble. And of course to include LaTeX style files (*.sty).

Is this the core of it?

Your approach certainly makes sense if you intend to produce several documents with the same printed layout, but I'm less convinced if it is for a single book? What is it that you gain by creating a specific LyX layout in this case?


After I've now hopefully gotten the background right, here's how you describe what you do.

What I typically do is:

1) Make the layout file
2) ln -s /bookdir/mybook.layout /home/slitt/.lyx/layouts/mybook.layout
3) Doublecheck the line that says #  \DeclareLaTeXClass[book]{mybook}, make
sure it matches the filenames.
4) lyx
5) tools->reconfigure
6) exit lyx
7) lyx mybook.lyx

It never shows document class mybook, until I turkey around for hours to get it to work.

I don't understand this... are you saying you often have problem making LyX find your .layout file?

We need documentation on exactly what to do, and how to troubleshoot layouts/document classes.

I agree, but you're probably the expert on creating customized LyX layouts ;-) So what do you suggest? What kind of documentation is needed?

cheers
/Christian

--
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

Reply via email to