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. – user11232 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. – jub0bs Apr 28 '14 at 16:33

A package is declared by writing:


When you load the package you write,


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.

  • 1
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.