It's not graphs. It's a .tex file that I want to include. I used \input and it worked fine. But as I keep writing more and more, the file got bigger and bigger and I decided to use chapterbib to make the reference clearer. I used natbib and I found for chapterbib to work, I must use \include and not \input.
When I changed to \include, it wouldn't compile any more.
I can't write on file `"Literature review/M.aux"'.
\@include ...\immediate \openout \@partaux #1.aux
\immediate \write \@partau...
l.67 \include{"Literature\space review/M"}
(Press Enter to retry, or Control-D to exit; default file extension is `.tex')
Please type another output file name
! Emergency stop.
\@include ...\immediate \openout \@partaux #1.aux
\immediate \write \@partau...
l.67 \include{"Literature\space review/M"}
I found this but it doesn't work. How to make \include work with a quoted string path containing spaces?
I tried some combinations.
This works: \include{review\M} (supposing I have a file call "M.tex" in folder of "review" and the folder "review" is in the same folder of my base tex file)
This works: \include{"M\space 1"} (supposing I have a file call "M 1.tex" in the same folder of my base tex file)
But this doesn't work: \include{"Literature\space review/M"} (supposing I have a file call "M.tex" in folder of "Literature review" and the folder "Literature review" is in the same folder of my base tex file)
Someone asked if this works: \include{"Literature review/M"}. No. It gives no error, but the output will simply be review/M.
I found someone said to change TEXINPUTS in bash. I did not understand it at all. I'm using windows. I don't know how to change the path.
I found this did not work either. How to include graphics with spaces in their path?
How could I make it work? Thanks!
Update:
I replaced all the spaces with underlines and still it didn't work. Is it because my file is too deep? It is \include{{"Folder_A/B/C/D/M"}}. LaTeX still reported that it could not write the 'Folder_A/B/C/D/M.aux' file. So perhaps it was not the spaces that caused the issue in the first place.
Any idea?
_for spaces, which should solve your problem. – Werner Nov 05 '15 at 01:40\include{{"Literature_review/M 1"}}first, it won't work. But If I type\include{{"Literature_review/M"}}first and then compile and then\include{{"Literature_review/M 1"}}, it will work. If I delete all the newly generated files, then when I type\include{{"Literature_review/M 1"}}and compile, it will fail again. I guess after a successful run of\include{{"Literature_review/M"}}the first time, LaTeX was brought into the relative path"\Literature_review"so that I when I ran\include{{"Literature_review/M 1"}}afterwards, it worked. – fyang Nov 05 '15 at 03:25\includecommand, then you may help me solve this problem as well. By the way, I'm now using the on-line editor ShareLaTeX. I don't know if they use Windows or Linux. I could 't change the files on their server either. So I need some code that I can type in the editor. – fyang Nov 05 '15 at 03:31\include{"Literature review"/M}or\include{{Literature review}/M}. Just a blind shot.. – Nov 05 '15 at 04:38\include{{"Folder_A/B/C/D/M"}}. LaTeX still reported that it could not write the Folder_A/B/C/D/M.aux file. So perhaps it was not the spaces that caused the issue in the first place. Any idea? – fyang Nov 05 '15 at 23:24\include{Folder_A/B/C/D/M}, I guess. Why do you need anything that deep in terms of directory structure? Seems very strange.... – cfr Nov 06 '15 at 00:23