Guy Rutenberg wrote:
Hi,

I'm trying to use a local LaTeX class (actually I'm writing it). I've put
the .sty file in the same directory as the lyx file but when I add
\usepackage{myclassname} it says it can't find myclassname.sty.

IIRC in previous versions LyX would find files in the current directory too.

I'm using Lyx 1.6.

Does it happens only to me or someone else experienced the same problem?



I don't recall LyX finding style files on its own, but that could be because I never tried what you've described. In any event, you don't need to put the .sty file in the same directory as the layout file, and in fact it is probably undesirable to do so.

The key is that LaTeX must know where to find the .sty file.  So

1. Create the style file somewhere in the LaTeX directory structure (typically something like <localtexmf>/tex/latex/myNewClass/myclassname.sty). This has the side benefit of protecting the file from deletion is you upgrade either LyX or your TeX distro.

2. Update the LaTeX file name database (run texhash on Linux, use the "Refresh FNDB" button in the MiKTeX settings application on a Windows system, so something magical on OS X, ...).

Note that if this really is a document class, rather than a package, you'll need to make the extension .cls, you'll need to kludge together a LyX layout file for it, and you'll need to reconfigure LyX to find the layout (*after* you've done step 2). But I'm guessing you meant "style" rather than "class" above.

/Paul

Reply via email to