Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

include a .tex file with spaces in the filename [closed]

I am including chapters in my latex file one by one by using the \include{} statement, up till now I've had no problem with that. But I've recently written a chapter which I've saved under a name including spaces...because you can.

Now the include{} statement apparently doesn't like spaces, and prints just the filename in my document in stead of the chapter.

It is probably a pretty easy fix (apart from removing the spaces in the filename, ;-) ), but I can't find it.

UPDATE

It doesn't bode well for this question according to this wiki. It says that you can't unless you use a recent distribution like teTeX 3 or MikTeX 2.4.

However one smidge of hope left, the page is dated 2005 (a lot can happen in 5 years) and I am using pdflatex included in ubuntu which I assume is a fairly recent distribution.

like image 741
NomeN Avatar asked Mar 15 '10 00:03

NomeN


3 Answers

Try

\include{"file\space name"}

(I.e., use quotes and \space.) You may need to remove old .aux files and/or run Latex twice.

like image 182
Alok Singhal Avatar answered Nov 15 '22 09:11

Alok Singhal


Well I'm closing this question by giving the (quite unsatisfying) answer, I've found (on this wiki).

At the moment the answer unfortunately is: you can't, unless you use a recent version which happens to handle this problem more gracefully. Examples: teTeX 3 and MikTeX 2.4.

It seems that unusual filenames are still a problem within latex, so your best bet is to abstain or, if you have to, find a version that has solved the problem.

like image 28
NomeN Avatar answered Nov 15 '22 10:11

NomeN


It works. What you need to do is if your chapter file is File Of Mine.tex then in the main .tex file put

\include{"File\space Of\space Mine"} 

but inside File Of Mine.tex you just need to have \chapter{File Of Mine}. Try this and see if it works for you. It does for me.

like image 7
Evans Avatar answered Nov 15 '22 10:11

Evans