Angus Leeming wrote:
Paul A. Rubin wrote:

Angus Leeming wrote:

The gurus at comp.text.tex or gmane.comp.tex.miktex are either silent or
they're suggesting I avoid "paths with spaces", so let's assume that
BibTeX can't handle such paths.

One suggestion, from Florian Schmitt on gmane.comp.tex.miktex is to use the
DOS alias name of directories, but that's problematic in its own right.

Another idea, which I think we should persue, is to copy the bibtex
database to the temp directory (mangling its name in the process) and to
use that in the latex file. Since the two files are in the same directory,
we'd use relative paths and things would 'just work'.

People who don't use the temp directory are on their own of course.

Thoughts?

Angus,

Will this have any implications with File->Export->LaTeX? Specifically, if the user selects a .bib file in a directory other than the one where the document lives, won't the export (potentially) give him an absolute path containing spaces?


I'll use the standard LyX rule to reference the file.

C:/
    foo/
        reference1.bib
    bar/
        subdir/
            reference2.bib
    myfile.lyx

Exporting myfile.lyx to latex:
\bibliography{C:/foo/references1}
\bibliography{subdir/references2}

So, the short answer is, yes, these paths can contain spaces on File->Export->LaTeX.

The other thing is, what happens if the file name itself contains spaces (e.g., 'my research.bib')? Will you convert spaces to underscores?


The name of the .bib file in the temp directory would be:
    ${ID}C__Documents_and_Settings_Rubin_My_Documents_my_research.bib

where ${ID} is some integer guaranteeing that the filename is unique.

 > And will that occur in the export as well?

No. On export you're on your own. If you try and break stuff by using spaces without due care and attention then I'd recommend using the contents of the temp directory.

Clearly, the solution is not optimal, but that would require a BibTeX that could cope with "files with spaces".

Angus



Would it take much work to have LyX pop up a warning message, should the user be so ill-advised as to export a file with spaces in the .bib path, alerting the user that he/she will not be able to compile the doc using LaTeX due to the spaces?

Not that I'm trying to add work for you, mind you. It's sort of a Law of Unintended Consequences thing. Those of us who've been using Windows ports of LyX are painfully familiar with the evils of spaces, but by making LyX more Windows-friendly, you're probably going to create a generation of new users who won't have any idea that anything LyX-related might gork at the sight of a space.

-- Paul

Reply via email to