19

I have the following files:

my_folder/
   include/
       mypackage.sty
   main.tex

The package's name is 'mypackage'. Now, in main.tex I do

\usepackage{include/mypackage}

using the file path rather than the package name. This works, but warns me:

You have requested package `include/foo' but the package provides `foo'

How do I avoid this without placing the document class file elsewhere?

einpoklum
  • 12,311

2 Answers2

7

You can disable the warning using silence package:

\documentclass{article}

\usepackage{silence}
%Disable all warnings issued by latex starting with "You have..."
\WarningFilter{latex}{You have requested package}
\usepackage{include/mypackage}

\begin{document}
\end{document}

Another solution was proposed here: https://tex.stackexchange.com/a/31950/65072

Desik
  • 2,119
  • 4
    Well, I guess that'd work, but it's a workaround rather than a solution... – einpoklum Mar 18 '15 at 03:54
  • Based on other answers: http://tex.stackexchange.com/questions/31925/install-package-in-subfolder, you can add "include" directory to your TEXINPUTS environment variable, that's the only other solution to my knowledge. But in this case you'll have a problem -- all your documents will be compiled with this new TEXINPUTS value. I use the solution with silence myself, it seems more modular. – Desik Mar 18 '15 at 08:17
  • ... but the document can't really make assumptions about the environment variables. – einpoklum Apr 18 '15 at 15:56
  • do you have any idea how I can file this as a bug report / feature request with the LaTeX project, officially? – einpoklum Jan 16 '16 at 17:12
  • 2
    I was searching for bug reporting many times - Latex community doesn't seem to use public bug trackers. You should probably contact the authors of latex/miktex/whatever by email. – Desik Jan 16 '16 at 20:57
2

I encountered a similar problem recently. The issue was that I'd copied original.sty in order to have a modified version modified.sty, but I'd forgotten to change \ProvidesPackage{original}[...] to \ProvidesPackage{modified}[...] in modified.sty. As such, I got the error You have requested package 'original', but the package provides 'modified'. Making the above change resolved the error.

Olivier
  • 208
Matt
  • 21