Uwe Stöhr wrote: > >> It's correct that Lyx doesn't allow spaces and other special > >> characters in the file dialog, because the \includegraphics command > >> used in the background doesn't allow them in image filenames. It > >> seems to be a restriction of the LaTeX-package "graphicx". > > > > Not so. I've just got this to work with MikTeX: > > > > If the file name contains spaces then the name must be enclosed in > > quotes. If the file name contains LaTeX special chars, then these must > > be escaped with \string. > > I also use MikTeX and can't get it to work. I tried to insert the files > "ima ge.png" and "ima%ge.png". But no matter if I use > > \includegraphics{"F:/Download/ima ge.png"} > or > \includegraphics{F:/Download/ima\string%ge.png} > or > \includegraphics{F:/Download/ima\string% ge.png} > > it doesn't work. > If one uses quotes, one mustn't declare the file extension, so only > > \includegraphics{"F:/Download/ima ge"} > > will work. We have to consider this behaviour.
We strip the extension already. See the "prepareFile" function in src/insets/insetgraphics.C. > If you find a solution for "ima%ge.png", please let me know. Try "ima\string%ge.png", analogous to the known-to-work "ima\string~ge.png". Let me know if it works, please. > thanks and regards > Uwe -- Angus