I use some .sty-files that are not part of texlive and want to have them in a subdirectory of the folder with my main.tex. I used the following line to load the package:
\usepackage{sty/prettythesis}
This works, but compiling the main.tex with xelatex and using rubber gives me a warning:
sty/prettythesis.sty: You have requested package `sty/prettythesis', but the package provides `prettythesis'. (page 1)
Is there a way to prevent this warning or handle this case without having to include "sty\" in all .sty-files' \ProvidesPackage command or set the TEXINPUTS environment variable (which seems not to be possible from the main.tex itself)?
sty ) into your document in two ways: If you have it in your path or in the same folder as the . tex file, simply include this line in your preamble: \usepackage{mystyle} If you have it in a different folder, you can access using its full path as \usepackage{/path/to/folder/mystyle}
sty files? If you want to install your own . sty files, then you should copy the files into the directory tex/latex/mystuff relative to a new TEXMF root directory.
sty or . cls files must be in some subdirectory of tex\latex which can be in any directory of any drive.
sty files are loaded by LATEX to provide and improve methods that are used to create documents. Generally speaking, class files implement the specific structure of the document, whereas packages are used to provide either generic functionality to any document, or to 'style' the methods provided by a specific class.
I believe this thread here:
talks about precisely the same thing: so it seems, the only alternatives are either using TEXINPUTS
environment variable; or using the import package. (note, there is a variant on the import
package on ...Including tex files pg 3.)
A bit more about TEXINPUTS:
Hope this helps;
Cheers!
EDIT: I hoped that one could set the TEXINPUTS path directly in the tex file (by using \write18
-- and note, some versions of LaTeX use --enable-write18
, mine uses -shell-escape
to enable \write18
; see also this) - but it seems it is not possible:
"... This isn't possible. ... The environment variable of the child process is set, but this hasn't an effect to its parent process (TeX)." (Re: Setting the environmental variable TEXINPUTS within latex - comp.text.tex).
... so, now I just call pdflatex
in my Linux bash
like this:
TEXINPUTS=.//:$TEXINPUTS pdflatex ./myfile.tex
and then it will resolve directly \usepackage{mypackage}
in the myfile.tex
file - even if mypackage.sty
is in a subdirectory, say ./subdir/mypackage.sty
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With