I've traced the problem with citations for a while, and I'm still kind of puzzled. This has something to do with the fact that EmbeddedFile objects, since they inherit from FileName, always store absolute pathnames. But in many of these cases, it seems that the EmbeddedFile objects actually just replaced FileName objects, and so the problem isn't the absoluteness of the path name itself, but that the absolute path name isn't being set in the right way. For example, here:
void InsetBibtex::createBibFiles(docstring const & bibParam,
  docstring const & embedParam) const
{
[snip]
  bibfiles = split(bibfiles, tmp, ',');
  embedStatus = split(embedStatus, emb, ',');
    while (!tmp.empty()) {
EmbeddedFile file(changeExtension(tmp, "bib"), buffer().filePath());
[snip]
}
we certainly ought not to be setting the path relative to the path of the Buffer. In the 1.5 code at the corresponding place, we have: FileName const texfile(findtexfile(changeExtension(tmp, "bib"), "bib")); where findtexfile uses kpsewhich to find the file. So we need to put that back somehow, but I don't understand how the embedding stuff works well enough to do it myself. Bo?

What about this:

diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index c46176e..c7fac5c 100644
--- a/src/insets/InsetBibtex.cpp
+++ b/src/insets/InsetBibtex.cpp
@@ -166,9 +166,14 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
        EmbeddedFileList::const_iterator it_end = bibfiles_.end();
        odocstringstream dbs;
        for (; it != it_end; ++it) {
- string utf8input = removeExtension(it- >availableFile().absFilename());
+               FileName fn = it->availableFile();
+               string utf8input;
+               if (it->saveAbsPath())
+                       utf8input = fn.absFilename();
+               else
+ utf8input = to_utf8(fn.relPath(buffer().filePath()));
                string database =
- normalizeName(buffer(), runparams, utf8input, ".bib"); + normalizeName(buffer(), runparams, removeExtension(utf8input), ".bib");
                FileName const try_in_file =
makeAbsPath(database + ".bib", buffer().filePath()); bool const not_from_texmf = try_in_file.isReadableFile();

Stefan

Reply via email to