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
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.
ian holliday
1 Oct 07 at 11:40 pm
Thanks that was very helpful!
Anonymous
16 Nov 07 at 12:47 am
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.
Anonymous
30 Jan 08 at 4:18 pm
Not working :(
Anonymous
11 Feb 08 at 1:42 am
And now it’s working! :D
Anonymous
11 Feb 08 at 1:49 am
@anonymous poster
Is there something you were missing out which you then incorporated or you changed something for it to work later?
Piyush Goel
11 Feb 08 at 8:28 am
where does one type
“#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[xxx]{article (xxx)}
# Input general definitions
Input stdclass.inc”
?
g
3 Aug 08 at 8:36 pm
@g just open notepad (assuming you are on windows) and type it in a new empty file. Then save it as xxx.layout where xxx.cls is the class file’s name.
Piyush Goel
3 Aug 08 at 10:50 pm