Discussion:
.Sty files in subdirectory
(too old to reply)
Wouter
2010-07-31 22:57:38 UTC
Permalink
Hello,

I've the following question. To make things a bit clean in my document
I placed some .sty files that I use as packages in a subdirectory of
the main .tex file.

The problem that I am facing is that when I compile the main .tex file
is that it can't find the package anymore. I tried to add the
subdirectories name to the name of the file as you would do when using
the \input{} command... so like this

\usepackage{subdirectory/somestyle.sty}

This however doesn't work either.

Is this what I'm trying to do (im)possible to achieve?

Regards,

Wouter
Joris
2010-07-31 23:09:51 UTC
Permalink
Post by Wouter
Hello,
I've the following question. To make things a bit clean in my document
I placed some .sty files that I use as packages in a subdirectory of
the main .tex file.
The problem that I am facing is that when I compile the main .tex file
is that it can't find the package anymore. I tried to add the
subdirectories name to the name of the file as you would do when using
the \input{} command... so like this
\usepackage{subdirectory/somestyle.sty}
This however doesn't work either.
Is this what I'm trying to do (im)possible to achieve?
Regards,
Wouter
Wouter,

Omit the .sty. The code below works fine for me on linux. As an
aside, if you use these sty files more frequently, they're best placed
somewhere latex can find them, after which you run texhash and you can
use them from then on.

Hope this helps,

J.


\documentclass{minimal}


\usepackage{../mooi}

\begin{document}

hello
\end{document}
Wouter
2010-08-01 11:58:39 UTC
Permalink
Post by Joris
Post by Wouter
Hello,
I've the following question. To make things a bit clean in my document
I placed some .sty files that I use as packages in a subdirectory of
the main .tex file.
The problem that I am facing is that when I compile the main .tex file
is that it can't find the package anymore. I tried to add the
subdirectories name to the name of the file as you would do when using
the \input{} command... so like this
\usepackage{subdirectory/somestyle.sty}
This however doesn't work either.
Is this what I'm trying to do (im)possible to achieve?
Regards,
Wouter
Wouter,
Omit the .sty.  The code below works fine for me on linux.  As an
aside, if you use these sty files more frequently, they're best placed
somewhere latex can find them, after which you run texhash and you can
use them from then on.
Hope this helps,
J.
\documentclass{minimal}
\usepackage{../mooi}
\begin{document}
hello
\end{document}
Thanks for your reply. I confirm, your code is correct and I made a
minimal example for my own as well. I figured out that the problem was
in the package itself, the signalflowdiagram (http://www.texample.net/
tikz/examples/signal-flow-building-blocks/).

It uses the two following lines of code that cause the trouble.

\ProvidesPackage{signalflowdiagram}[2006/12/30 v0.1 Signal flow
diagrams]
\usetikzlibrary{signalflowdiagram,signalflowarrows,signalflowoperators,signalflowblocks}

The first line causes a warning, the compiler reports that you asked
for the package "subdir/signalflowdiagram" and not for
"signalflowdiagram". The second line is the real problem, along with
the package there were some other .tex files. It can't however find
these anymore after placing it in a subdirectory. Changing the line
to

\usetikzlibrary{subdir/signalflowdiagram,subdir/
signalflowarrows,subdir/signalflowoperators,subdir/signalflowblocks}

will not solve the problem either. Tikz uses its own interpreter for
libraries; seeing that the .tex file "signalflowdiagram" is actually
called "tikzlibrarysignalflowarrows.code.tex".

I think I will just stick then in keeping my .sty files in the same
directory as my main.tex file.

A shame however that it doesn't work as easy as I thought it would,
like the \input{} command. I'm guessing that you could solve the
problem but thats too much trouble right now.
Martin Heller
2010-08-01 12:39:58 UTC
Permalink
Post by Wouter
A shame however that it doesn't work as easy as I thought it would,
like the \input{} command. I'm guessing that you could solve the
problem but thats too much trouble right now.
You can set the TEXINPUTS environment variable:

export TEXINPUTS=.:/path/to/input/files/:$TEXINPUTS

Loading...