Spaces in directory names and graphicx.

theodore.norvell's picture

I'm running SWP 5.5 under VMWare. My files are on my Mac's disc, while SWP is running on windows. VMWare provides a way to access files on the Mac disk via a network share, which is
\\vmware-host\Shared Folders\
I don't think there is a way (or know of a way) to change this name. Since it has a space in the directory name, it messes up my graphics includes. For some reason, graphicx sticks part of the file name in along with image into the output. (See the attached image.) This is with TrueTex and the dvi previewer. PDFLaTeX works file.

Now here is the weird part. If I do a Save As (Portable LaTeX), give the file tex file a new name, and then compile and preview, the file name is gone. (At least sometimes.) But if I close the file and open it again, the problem comes back.

I can duplicate the problem on the C: drive if I put a space in a directory name. I'm attaching an example tex file and image. The problem should show up if there is a space in the path -- e.g. if the .tex file is placed in a directory with a space in its name. If the problem doesn't show up at first, try closing the file and reopening it. The inclusion of grffile is supposed to help with the problem, but it doesn't.

Screen Shot 2014-04-01 at 14.43.23 .png19.38 KB
mtndfa.png6.45 KB
a.tex1.5 KB
theodore.norvell's picture

I found a crazy way around

I found a crazy way around it. Open the file as Z:\... (instead of \\vmware-host\Shared Folders\... . Then make a small change to the file, undo the change, save, and preview. Then it works. If instead I make a small change to the file, undo the change, save, compile and preview, then the problem comes back. (Note the extra compile step.)

I think this has to do with SWPs habit of copying everything to a different directory before compiling.

I think the choices are

I think the choices are either to save using the SWP/SW/SN file type or to not have any spaces in your directory or file names.  That you don't see the issue when compiling for PDF is probably because the graphics get converted and moved to a directory that does not have a space in the file name.  You can inspect the saved .tex file (either the temporary version created or after setting Typeset, Output Choice to PDF) to see the directory used for the graphics.

theodore.norvell's picture

Where does it save the

Where does it save the temporary .tex file?

Typically in the Windows

Typically in the Windows temporary directory, but if that path includes a space (as was common with some versions of Windows) then a temp directory below the install directory was created.  Use Tools, User Setup, and the Files tab and scroll to the bottom of the Directories list to see the temporary directory being used by your system.