GeneralStrange warning about style file

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Strange warning about style file

Post by php1ic »

I am very organised when I write large documents and have a directory for non-standard .sty files that I have to download. At the moment, my document compiles, but I'm getting a warning message which I can't make any sense of

Code: Select all

(/usr/share/texmf/tex/latex/fancyhdr/fancyhdr.sty)
(/usr/share/texmf/tex/latex/setspace/setspace.sty
Package: `setspace' 6.7 <2000/12/01>
) (./Style_files/subeqn.sty) (./Style_files/tensor.sty

LaTeX Warning: You have requested package `Style_files/tensor',
               but the package provides `tensor'.

) (./thesis.aux (./abstract.aux) (./chapter1.aux) (./chapter2.aux)
As you can see the other .sty file in the directory is read with no problem. Does anybody have any idea what this message means and how I can get rid of it?

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Strange warning about style file

Post by fatra2 »

Hi there,

Since you said that you have just downloaded these files, they might not be "included" in your tex distribution. Meaning that when you compile you code, these files might not be included by the compiler.

Talking about "/usr/share/" I can see that you working on a *nix base system. Did you reboot your machine since you downloaded these files??? By rebooting the box, it runs a few commands that are necessary by the Tex compiler. If you have not reboot, please don't, there is almost always a way with Linux without!!! To place everything in order, compiler side, you need to run:

Code: Select all

texmf
or

Code: Select all

hash****
(not sure for the rest) in the command line. Both commands do exactly the same job.

If your problem persist after that, let us know. Cheers
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Strange warning about style file

Post by php1ic »

Thanks for the advice but I actually downloaded these files quite a while ago and have used them in other smaller documents without this warning.

It was looking at those that lead me to the answer. The cause is the following line in the .sty file

Code: Select all

\ProvidesPackage{tensor}
As I have created a directory for the style files, I include them with

Code: Select all

\usepackage{Style_file/tensor}
rather than

Code: Select all

\usepackage{tensor}
As a result, latex gets confused and thinks it is the wrong package so gives a warning. The .sty file it accepts doesn't have the \ProvidesPackage line which is why there is no warning for that one.

Instead of simply writing report as the document class, try giving the full path and you will get a similar warning message.

Thanks again.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Strange warning about style file

Post by phi »

LaTeX simply compares the arguments given to \usepackage and \ProvidesPackage. It doesn't really have a notion of "directory." So the solution is to avoid directory names in \documentclass or \usepackage commands. If you want to place some packages in a special directory, you have to create and register a texmf tree.
Post Reply