On Tue, Mar 1, 2011 at 12:41 AM, Jürgen Spitzmüller <[email protected]> wrote:
> Richard Heck wrote:
> > > 1. create a file "master.lyx" and edit the LaTeX preamble to include
> > > "\usepackage{import}"
> > > 2. Insert ERT "\subimport{subdir}{trythis.tex}"
> > > 3. create "trythis.tex" in subdir
> > > 4. Compile.
> > >
> > > This will fail.
> > >
> > > If you export your "master.lyx" file to a LaTeX file, it will work.
> > >
> > > Is there a way to get this working in LyX?
> >
> > I'm guessing that maybe import.sty needs more LaTeX runs than we do?
>
> You have to remember that the file is copied to and processed in a
> temporary
> directory. So if \subimport points to a relative path, this path will need
> to
> be relative from the temporary directory. Absolute paths should work,
> though.
>
> Jürgen
>
The problem with this is that relative directories are very useful when
sharing documents among various people, since the absolute path will be
broken the moment you move the directory structure to another machine.
Can't LyX sort through this issue in the same manner as it does with
graphics paths, i.e. by transforming relative paths to absolute paths when
the LaTeX is exported to the temporary directory? So behind the scenes, LyX
could change:
\subimport{ relative path }
to
\import{ absolute path }
when it exports the temporary files...
James