# the new template doesn't work well

I was going crazy with the LyX and MikTeX configuration for a new class,I think I have done it matching the step! but None I get

here what i've done:

Get a copy of the class file, and copy it into a folder with the same name into `C:\Users\AppData\Roaming\MiKTeX\2.8\tex\latex.` So, for `ociamthesis.cls`, you should have a folder called `ociamthesis` within `C:\Users\\AppData\Roaming\MiKTeX\2.8\tex\latex`. This is Windows Vista / Windows 7 specific, you will soon see why… Create a new file and paste the following into it:

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

Input `stdclass.inc` replacing xxx with the class name (without the .cls extension).

In my case, xxx is `eethesis`, and the code above becomes:

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

Thanks goes out to Adding a new class in LyX for this.

Save this file to ```C:\Program Files\LyX16\Resources\layouts```, naming it `ociamthesis.layout`. In a command prompt (type cmd in start menu), type texhash. What you will now see it doing is iterating through several folders for new classes, one of which (`C:\Users\AppData\Roaming\MiKTeX\2.8\`) is where we copied the ociamthesis.cls class file into. Within Lyx, hit Tools > Reconfigure, then restart Lyx.

but when I try to run, I get this error message : LaTeX Error :

``````File 'ociamthesis.sty' not found
``````

Can anyone help me?

-

## 1 Answer

I don't use Lyx (and looking at your complicated description I'm quite grateful ;-)) but two remarks:

1. you add a `.cls` file while your error message miss a `.sty`. If you quoted the error message correctly, your lyx configuration is probably wrong.
2. If the error message actually says that the `cls` is not found then either your root (`C:\User\...\2.8`) is either not a known root of miktex or you didn't update its FNDB. Check in miktex settings if the root is listed (check "show miktex roots) and update the FNDB. If you have a multiuser setup do it in user and admin mode.
-
I run MikteX as Admin, the roots are C:\ProgramData\MikTeX\2.8 and C:\Program Files\MikTeX2.8 but when I run it as user, the roots are C:\Users\win7\AppData\Roaming\MikTeX\2.8 and C:\Users\win7\AppData\Local\MikTeX\2.8 beside the two above. so there are 4 root of MikTeX if I run it as user. yes, I've done All of your suggestion, but I still get the same error message?? – Verly Jun 11 '11 at 3:34
You didn't say if your error message actually miss a .sty or .cls. I can't help you if you got the lyx part wrong. But to test the miktex part: Make with an editor a small latex document `test.tex` which starts with `\documentclass{ociamthesis}` and compile it on the command line with `latex test`. If `ociamthesis.cls` is found the miktex part is ok. – Ulrike Fischer Jun 11 '11 at 10:22
thanks Ulrike, I found my mistake, some packages in ociamthesis not yet instal in my MiKTeX, now the template is running well, but I get new problem, althought it's running well but the new environments I've define and create in ociamthesis can't appear in the lyx dropdown menu environment. do you know why ? – Verly Jun 15 '11 at 9:04
No. As I said: I'm not using lyx. – Ulrike Fischer Jun 15 '11 at 9:13