# \input{<file>.pstex_t> does not work through an \import instruction [closed]

I have a directory structure:

``````maindir  (this is where the main latex file is)
``````

and then

``````subdir1/
subdir2/ ...
``````

in the main file I do

``````\import{subdir1/}/sub1}
\import{subdir2/}/sub2}
``````

etc.

In `sub1.tex` I have

``````\include{fig.pstex_t}.
``````

It compiles ok to dvi, but not really ok, because it does not find the `.pstex` file. Hence the dvi viewer gets stuck. If I do dvi2ps or dvi2pdf I get a pdf without the figures themselves.

On the other hand if I copy the generated .`dvi` file into subdir1 and open it from there, then I can see the figures (related to that directory) just fine.

So my question is: how do I tell it the path to the associated `.pstex` files ?

-
 You probably want `\input` not `\include` for fig.pstex_t `\include` forces a new page and saves counters etc so doesn't really make sense here. The path is relative to where you start tex so you probably want `\input(subdir1/fig.pstex_t}` but it depends a bit what path to the graphics file is in the generated file. – David Carlisle Mar 12 at 12:24 it was my mistake to write above that I use \include. What I meant was \input, as you suggest. Yet the problem persists. I tried \input{subdir1/fig.pstex_t} as suggested and it does not work. The only thing that I found so far that works is to go into the .pstex_t file and change manually the path to the .pstex file, e.g.: \special{psfile=subdir1/fig.pstex}% but it doesn't make much sense to do that manually for each file, because these files are automatically generated. So I wouldn't want to manually change them after every change to the figure. Any idea ? – user1743977 Mar 13 at 13:33 what does the line in your _t file that is including the graphic say (in particular does it use a path) – David Carlisle Mar 13 at 13:35 Oh you can probably just add subdir1 to your graphics path using `\graphicspath` command. – David Carlisle Mar 13 at 13:37 Here is what eventually solved it: as I wrote above, t he problem is the missing path in the \special directive that includes the .pstex file. So from the parent directory I ran "for a in \$1/*.fig ; do fig2dev -L pstex \$a > `echo \$a | sed s/.fig/.pstex/` ; done" where \$1 is the name of the subdirectory. This puts the path in the \special directive and solves the problem. – user1743977 Mar 14 at 19:03

## closed as too localized by lockstep, Stefan Kottwitz♦Apr 11 at 12:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.