I think the problem is that LyX does not copy the
"../common/preamble.tex" file over at the temporary build directory
(usually something like /tmp/lyx_tmpdir.XXXX/lyx_tmpbufX/ by default).
I have encountered this kind of behavior before (albeit in a different
case) but I could not find any reasonable solution beyond providing the
full path. It would be nice if there were a solution to this. For your
case, unless you must maintain this kind of directory structure, it
might help you if you put your preamble.tex file in the same directory
as your *.lyx file and use \input{preamble.tex} instead of a relative
path.
Although I am not entirely sure, in LyX 1.6.x there was a way to tell
LyX to use the current WD instead of a temp one.
Spyros
On Thu 20 Oct 2011 05:25:57 PM EEST, Oscar Lopez wrote:
> Dear LyXers
>
> I have recenty updated my lyx version to lyx 2.0.1 and I have found that
> using relative paths to tex files at the lyx preamble does not work anymore.
>
> I have directory structures where lyx files are at some directories, bib
> files at other, latex preamble commands at othes, and so on ... The lyx
> preamble contains some input commands to take the corresponding latex
> preamble, i.e.
> \input{../common/preamble.tex}.
>
> In this way I can share project directories with other colleagues (for
> instance using svn). We always use relative paths in order to ensure that the
> compilation does not break.
>
> Now when I am trying to compile some documents from lyx 1.6.10 I have found
> that lyx 2.0.1 stops the compilation saying
> LaTeX Error: File `../common/preamble.tex' not found
>
> If I export the latex file using Export->latex (pdflatex) and from a terminal
> I run pdflatex:
> $pdflatex test.tex
>
> everything is ok!
>
> Attached to this message you can find a minimal example showing the problem.
> Look at the file located at test/doc/test.lyx and try to pdflatex it from lyx
> and after from a terminal.
>
> Please has something changed regarding the treatment that lyx gibes to
> absolute versus relative paths? Hope not! I am completely puzzled with this
> behaviour and perhaps I am missing something evident.
>
> Best regards
> TIA
> Oscar
>
>
>