On Tue, Nov 27, 2012 at 5:34 PM, Roey Angel <angel.r...@gmail.com> wrote:

> Hi,
> Not sure if it's a bug or I'm missing out on something but when I enter a
> bib
> source to the preamble it only works when the path to the bib source is
> absolute
> but doesn't in case I simply write the file name (yes, I double checked
> the bib
> file is in the same directory).
> I don't get an error but simply a PDF with the reference fields
> unrecognised (so
> it's got to be that lyx can't find the bib file).
>
Since Lyx compiles the tex files in a temp directory, I doubt a relative
path would ever work. Lyx would have to parse the preamble, extract the
path, convert it to an absolute path (or a new path relative to the temp
directory), and rewrite the preamble accordingly.
In fact, if you add the bibliography with the Lyx inset (i..e using bibtex,
not BibLateX) and then check the lyx source, you'll see that Lyx uses the
absolute path.


> If I export the file to LaTeX and compile it from command line everything
> works
> fine.
>
>
This is because if you export to Latex and then compile, you are working in
your local directory (the directory where your original lyx file is). And
Latex (or rather, biber) is therefore able to find the file from the
relative path.


> my preamble line looks something like
>
> \usepackage[style=authoryear-
>>
>> comp, natbib=true, backend=biber]{biblatex}
>> \addbibresource{/full/path/to/bib/file.bib}
>>
>>
>
This looks fine---as long as /full/path/to/bib/file.bib is really
/absolute/path/to/file.bib



> So, a bug or a 'feature'?
>

Feature, p/h? It has a great educational value: it forces you to understand
how lyx uses the latex (and biber, texindy, etc) backends ;-)

Cheers,

Stefano


-- 
__________________________________________________
Stefano Franchi
Associate Research Professor
Department of Hispanic Studies            Ph:   +1 (979) 845-2125
Texas A&M University                          Fax:  +1 (979) 845-6421
College Station, Texas, USA

stef...@tamu.edu
http://stefano.cleinias.org

Reply via email to