The patch does not look nice, but seem to work. One problem I find is that if I export the file to latex, the mangled bst filename will be used.
I expect someone to jump in and say 'this is not a lyx bug and we should not fix it.' :-) Bo
Index: src/insets/insetbibtex.C =================================================================== --- src/insets/insetbibtex.C (revision 13500) +++ src/insets/insetbibtex.C (working copy) @@ -207,8 +207,25 @@ int nlines = 0; if (!style.empty()) { + string new_style = style; + // if style contains space, copy to the tmp directory + if (contains(style, ' ')) { + string const in_file = style + ".bst"; + if (IsFileReadable(in_file)) { + // use new style name + new_style = FileName(style).mangledFilename(); + string const out_file = MakeAbsPath(new_style + ".bst", + buffer.getMasterBuffer()->temppath()); + bool const success = copy(in_file, out_file); + if (!success) { + lyxerr << "Failed to copy '" << in_file + << "' to '" << out_file << "'" + << endl; + } + } + } os << "\\bibliographystyle{" - << latex_path(normalize_name(buffer, runparams, style, ".bst")) + << latex_path(normalize_name(buffer, runparams, new_style, ".bst")) << "}\n"; nlines += 1; }