Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ! :)

share|improve this question
1  
\input{"File Name"} Use quotes –  Steven B. Segletes Jul 17 at 12:27
1  
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 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 at 12:48

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer
    
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 at 12:47
    
+1 for the musical divertimento. :) –  jja Jul 17 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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