Categories
Productivity Technology

Adding a new class in LyX (windows)

In case you are wondering what is LyX, see here.

To add a new custom class into LyX (Windows), it can be tricky as it is non intuitive. Here’s a small tutorial on how to do it.

1. Copy the xxx.cls file in ~\miktex###\tex\latex\
(where ### is the version (may or may not exist))

2. Make a layout file matching the class file (xxx.layout) like this (you may add extra settings), replacing xxx by your class name in the layout file:

#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[xxx]{article (xxx)}
# Input general definitions
Input stdclass.inc

3. Copy this file to the \Lyx###\Resources\layouts\

4. Go to Start > Run ; type in ‘cmd’ and press enter ; on the command prompt type ‘texhash’

5. In LyX, do: Tools > Reconfigure ; Restart Lyx.

Now you should be able to use the document class in LyX as usual: Document > Settings > Document Class > Document Class > xxx

9 replies on “Adding a new class in LyX (windows)”

HI . – I’m just starting with Lyx too. I’ve had it installed for ages, and just tinkered with it, but I need to use a particular publisher’s latex book style and found the lyx manual just too daunting. This little bit of advice worked straight off as far as I can see, so thanks for that. All I’ve done really is install the xxx.cls into miktex and point lyx at it using the book.layout. The next thing is to try and modify the layout to take advantage of the additional elements of the publishers cls, although they say anything in latex using book.cls can be processed with their cls.

Thanks a lot. This is the only place where I found an advice on how to install new classes under windows. Lyx documentation was only for Linux and very obscure.

where does one type

“#% Do not delete the line below; configure depends on this
# DeclareLaTeXClass[xxx]{article (xxx)}
# Input general definitions
Input stdclass.inc”
?

Thanks for the tip. Specially for explicitly telling me that running texhash means simply to type “texhash” in the command prompt (detail often overlooked by linux users, but a relevant one).

Maybe I can give Lyx a chance now.

Comments are closed.