11

I'm going crazy...

I have a file I want to include which path is C:\Users\Matthieu\Documents\Folder withOneSpace\myFile.tex. (As you can see with the \, I'm on windows actually)

I tried the following but none works:

\input{C:/Users/Matthieu/Documents/Folder withOneSpace/myFile}
\input{C:/Users/Matthieu/Documents/Folder\ withOneSpace/myFile}
\input{C:/Users/Matthieu/Documents/Folder withOneSpace/myFile.tex}
\input{C:/Users/Matthieu/Documents/Folder\ withOneSpace/myFile.tex}

I also tried to put the file out of the folder with a space and it works (no surprise):

\input{C:/Users/Matthieu/Documents/myFile} --> Works

All I found is to put a \ before the space but it doesn't work at all. --> Please help ! :)

  • 4
    \input{"File Name"} Use quotes – Steven B. Segletes Jul 17 '14 at 12:27
  • 2
    as Steven said " also it's generally easier just to use \input{myFile} and arrange that your folder is in the TEXINPUTS path that way your document is portable and avoids the problem entirely. – David Carlisle Jul 17 '14 at 12:30
  • Thanks guys, I tried with " before to post but it didn't works because my editor was configure to automatically replace " by some french quote... – Matthieu.P Jul 17 '14 at 12:48
15

Use the double quote symbol ". In this case, the file File Name.tex contained the words Hello World

... and Repin Painting.jpg contained, well, "Barge Haulers on the Volga" (Russian: Burlaki na Volge, Бурлаки на Волге), best viewed while listening to Lydia Salnikova perform Ah Ty Step Shirokaya http://www.broadjam.com/artists/songs.php?artistID=81353&mediaID=529836.

\documentclass{article}
\usepackage{graphicx}
\begin{document}
Testing\par
\input{"File Name"}\par
\includegraphics[width=2in]{"Repin Painting"}
\end{document}

enter image description here

  • Thanks ! I also tried with " but it didn't works because my editor was configure to automatically replace " by some french quote... Now it works well – Matthieu.P Jul 17 '14 at 12:47

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.