I'm trying to compile a LaTex document using the LaTeXing package in ST3. If the file is on my local disk 'C:*' it compiles fine, but I have to keep it on a networked drive '\[company_site]*' which I believe is referred to as a UNC path. Trying to compile the document from the networked location gives me the following error (personal info removed):

E: \\[company_address]\[path]\report.tex:0 Undefined control sequence
E: \\[company_address]\[path]\report.tex:0 Undefined control sequence
E: \\[company_address]\[path]\report.tex:0 Undefined control sequence
E: \\[company_address]\[path]\report.tex:0 Emergency stop

I guess the backslashes at the start cause the path to be interpreted as a command. How can I edit my build command to fix this error?

  • Exactly how are you compiling here? Manually in a dos promt, or through an editor? – daleif Sep 25 '14 at 9:12
  • 2
    Did you try with / instead of \? – egreg Sep 25 '14 at 9:24
  • @daleif I'm compiling through the editor. Running pdflatex in a dos prompt works fine, but I think the editor uses latexmk which I'm not sure how to use, so I can't check that. It would be much more convenient to get it to work through the editor. – raiksey Sep 25 '14 at 11:47
  • @egreg The path is automatically generated. I don't know how I would change the slashes. – raiksey Sep 25 '14 at 11:48
  • When you open the file, do you double click on it? I have seen this before, the editor will end up with one path specification if you double click and another (working) path if you start the editor and then navigate to the file via the File -> Open interface. (it is a real pain the B**! – daleif Sep 25 '14 at 12:01

Well, the Windows backslash file path seperator \ is used in (La)TeX to indicate a control sequence (aka. macro). That is why you get a Undefined control sequence error. In this case it takes \report as a macro.

Normally you need to exchange it with the Unix file path seperator / instead, which under (La)Tex also works under Windows. Not sure if network paths work, I never tried that.

You could also try to wrap the file name in an \unexpanded{ .. } statement (doesn't work with very old or nonstandard LaTeX versions), which might work or not dependent on the underlying implementation of the macro you are using to process the file path.


So I fixed it by passing the filename as the argument instead of the whole path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.