1

Consider the following MWE:

\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\includegraphics[width=0.5\textwidth]{knightstour.eps}
\end{document}

where knightstour.eps can be downloaded from http://people.sc.fsu.edu/~jburkardt/data/eps/knightstour.eps

If I save this .tex file and the .eps file anywhere locally on my computer, it will compile fine with no errors.

However, if I move these two files to a network drive, then it won't compile and gives an error. TeXStudio shows the following message:

'\\fileserver\TeX files' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory.

Sorry, but epstopdf did not succeed. The log file hopefully contains the information to get MiKTeX going again:

The log file shows

Package pdftex.def Error: File `knightstour-eps-converted-to.pdf' not found: using draft setting. ...phics[width=0.5\textwidth]{knightstour.eps}

What I've tried

I've tried adding a graphics path like this

\graphicspath{{\\fileserver\TeX files}}

and because it has spaces I've also added \usepackage[space]{grffile}. But that still gives the same error.

Additional info

I'm using Windows 10 and MikTeX. For some reason, when I use TeXworks, out of the box it all works fine and I am able to compile the file with no issues when saved on the network drive. Is the issue with the way TeXstudio is set-up?

Mike
  • 416
  • 2
    Each share on your pc also have a drive letter associated with it, have you tried that path instead. The \\... are called ANC paths (as far as I remember), and these are not supported by for example the good old command prompt. So depending on how latex is exacuted by your editor, you may end up in a situation where such a path is not supported. – daleif Apr 24 '19 at 15:54
  • 1
    Daleif is correct that some applications (in this case TeXstudio) prefer to be using a conventional windows mapped drive, due to the way it manages (or not) file handles (some will allow for other apps to make the background changes to file contents but await a suitable file change signal. This is a notorious issue with cloud / synchronized drives, it is always saver to script a check-out, compile, check-in sequence similar to those used by professional file managers. You will see many issues caused by the multi-part processing tex uses as editor compiler & viewer all compete for file control. –  Apr 24 '19 at 16:19
  • Here is a related problem with a network drive where synctex can have similar issues both with and without spaces I have had several reports where the PDF viewer has also failed to update the compilation with or without file locking problems https://tex.stackexchange.com/questions/201651/go-to-source-code-function-with-texstudio –  Apr 24 '19 at 18:58

1 Answers1

2

I solved this problem by mapping my network drive to a Z: drive on my computer.

Instructions

  • Click Start and then right click on Computer and select Map Network Drive...: (On older computers: Right click on My Computer)

  • Set the Drive pulldown box to Z:

  • Type into the Folder box the location of your file server, including the slashes: e.g. \\fileserver\TeX

  • Press Finish.

Then open your .tex file from the Z: drive location on your computer.

References

Mike
  • 416
  • First link is a good description of how to set basic mapping, however Second link is a dupe of a better selection of alternatives at https://stackoverflow.com/questions/5949775/windows-bat-file-error there are more specialist solutions required for corporate or academic users like those on SharePoint/VPN but they need to contact their IT dept. –  Apr 25 '19 at 11:27