I'm new to LaTeX, and I can't work out why I'm getting a warning when adding a package I downloaded (from the MATLAB website called mcode.sty).

Here is my code, `\usepackage{myFolder/mcode}`. I put `mcode.sty` in the `myFolder` folder. For some reason, I get the following error:

LaTeX Warning: You have requested package `matlabAssignment1/mcode'

Am I doing something wrong, or is it the program (I'm using Texmaker).

-
You can try giving the full path of the `mcode.sty` or put the file `mcode.sty` in the same folder as your `.tex` file. – Harish Kumar Mar 13 '12 at 4:26
I believe that `mcode.sty` needs to specify `ProvidesPackage{myFolder/mcode}`. – Peter Grill Mar 13 '12 at 4:29
You might be interested in the `matlab-prettifier` package; see this answer. – Jubobs Apr 28 '14 at 16:33

A package is declared by writing:

`````` \ProvidesPackage{mcode}[\filedate\space\fileversion]
``````

When you load the package you write,

`````` \usepackage{mcode}
``````

You do not specify any folders either in the `\usepackage` macro or the `\ProvidesPackage`. What you need to do is install it in a directory where TeX can find it.

If you read the `mcode.sty` file, you will notice that it has been written correctly and my guess is that if you drop it in the same folder like your document, it will work with no issues.

Have a look at install package in subfolder to see how you can install it properly in a subfolder.

-
If I put it in the same folder as my tex folder, there're no warning thrown. I don't really understand why the code I have works, if you're not allowed to specifiy folders in the \uselackage. – user968243 Mar 14 '12 at 13:12