Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

character spaces in windows directory names with latex

0 views
Skip to first unread message

Harriet

unread,
Jul 10, 2002, 8:34:28 AM7/10/02
to
I use a pc with windows 2000 and have recently installed MikTex and
WinEdt as I got tired of Word crashing all the time and thought I'd
better learn how to use latex before I start writing my thesis! I
have also downloaded bibdb to manage my bibliography of papers read.
My problem is this:
I keep my bibliography on the pc, in a directory structure as follows:
c:/documents and settings/myuserid/my documents/references/*.bib
All my 'reports' (ie conference papers, thesis etc) are stored in:
c:/documents and settings/myuserid/my documents/reports/thesis/*.txt

I cannot get my paper, written using winedt, to find the bibliography
and thereby put in my references when I compile. I have tried all
sorts of ways of referring to it but it really doesn't like the gaps
in directory names like 'my documents' (and I have tried re-naming
them but they are windows defaults and it won't let me). I've tried
putting quotes, single and double, about the whole string, each
directory with gaps in its name, forward and back slashes before and
after each gap in a directory name, using the dos shorthands for the
directory names
(eg \bibliography{c:/'Docume~1'/myuserid/'Mydocu~1'/'refere~1'/litmaster}
etc. etc.
I will also have a similar problem when it comes to all my figures and
diagrams as these are stored in a directory structure (under 'My
Pictures' another windows default) which tells me exactly which
experimental configuration which picture came from.
I am aware that gaps in a directory name are something latex doesn't
like (I've been searching on the web for solutions) but haven't found
one that really tells me how to solve this. Can anyone tell me what
to do?
Any help much appreciated
Thanks very much
Harriet

Oliver Corff

unread,
Jul 10, 2002, 4:20:21 PM7/10/02
to
Harriet <ha_h...@yahoo.co.uk> wrote:

: in directory names like 'my documents' (and I have tried re-naming


: them but they are windows defaults and it won't let me). I've tried

You should be able to remove the spaces in file names. If not, create
a new subdirectory where your thesis material resides, and run latex
there.

Oliver.
--
Dr. Oliver Corff e-mail: co...@zedat.fu-berlin.de

Dan Luecking

unread,
Jul 10, 2002, 4:30:12 PM7/10/02
to
On 10 Jul 2002 05:34:28 -0700, ha_h...@yahoo.co.uk (Harriet) wrote:

>My problem is this:
>I keep my bibliography on the pc, in a directory structure as follows:
>c:/documents and settings/myuserid/my documents/references/*.bib
>All my 'reports' (ie conference papers, thesis etc) are stored in:
>c:/documents and settings/myuserid/my documents/reports/thesis/*.txt
>

This is easy. I solved it ages ago: I put all my work in
subdirectories of c:\work\ and I don't create any directories
there that have spaces in their names. I also set environmental
variables TEMP, TMP and HOME to point to a path without spaces.
Problem solved. Hardly any TeX tools wll even bother with any
other directories not in the TeX tree. (I'm so paranoid about
filename probelms I even avoid long names. My local texmf
directory is "c:\localtex".)

Microsoft was just showing off when it named system default
directories with spaces. This already makes it confusing to read
Environmental variables. It forces additional levels of filename
processing in programs (check for quotes around flenames, add them
only if not already there. Try to program batch files for all the
cases.) I'm sure Microsoft is intentionally trying to make it
hard for Unix-style tools to work in Windows.

>I cannot get my paper, written using winedt, to find the bibliography
>and thereby put in my references when I compile. I have tried all
>sorts of ways of referring to it but it really doesn't like the gaps
>in directory names like 'my documents' (and I have tried re-naming
>them but they are windows defaults and it won't let me). I've tried
>putting quotes, single and double, about the whole string,

Double quotes _can_ work in some cases, depends where you typed them,
and for what program.

> each
>directory with gaps in its name, forward and back slashes before and
>after each gap in a directory name, using the dos shorthands for the
>directory names
>(eg \bibliography{c:/'Docume~1'/myuserid/'Mydocu~1'/'refere~1'/litmaster}
>etc. etc.

You have to disable TeX's interpretation of ~ as a special character.
(and you don't use quotes then): c:/Docume\string~1\myuserid/...

>I will also have a similar problem when it comes to all my figures and
>diagrams as these are stored in a directory structure (under 'My
>Pictures' another windows default) which tells me exactly which
>experimental configuration which picture came from.

LaTeX's \graphicspath and its routines to parse filenames might not like
quotes around names. It doesn't mind spaces in them, except when \input
is finally invoked, which doesn't like spaces.

TeX has been designed with a basic command \input. Normally it takes a
space as ending the name. MiKTeX amends this to allow spaces if the
name is (double) quoted. On the otherhand, some tools used with TeX
don't like spaces. If a chain of tools is invoked, quotes may get
stripped, and if even one tool does this (batch files processing can
do this) then later tools in the chain, even space-aware tools,
will fail.

Go to a directory without spaces, and stay there. Resist the modern
fascination with spaces and use only good, solid names.


Dan

--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701

Ian Konen

unread,
Jul 10, 2002, 7:22:25 PM7/10/02
to
Another possibility. If you don't want to radically re-align your
directory trees, just move your thesis.tex higher up. You can reference
relative paths without going all the way back to c:

So if your main file is in


c:/documents and settings/myuserid/my documents/

then
/figs
means
c:/documents and settings/myuserid/my documents/figs/
(you probably knew that already.)

Apparently, you can back up ONE directory level using /../ (even into a
directory named with a space), so then you could put your thesis.tex
file into

c:/documents and settings/myuserid/my documents/thesisfolder/

(if your concern is not cluttering up "My Documents" with all the .aux,
/log etc. files.) Then you could get to your references folder with

/../references/

It still means you'll have to move all your graphics out of My Pictures,
but you could put a folder inside "My Documents" and name it
"mypictures", then move the entire folder heirarchy from My Pictures to
My Documents/mypictures. Hopefully that wouldn't interfere with
whatever other uses you have for keeping all your figures in "My Pictures"

I couldn't figure out how to back up two or more directories, but that
still wouldn't have solved your problem with having to get back down
into "My Pictures".

Personally, I try to keep all included and referenced files in the same
folder or below the main file so that all path references are relative.
Then if I want to move the entire project to another machine, I know I
just need to drag the folder to the destination, and everything it needs
will go with it (minus possibly some .sty files that I've added to my
localtexmf directory, but I've gotten them all from CTAN, so I know I
could get them again if I forgot to bring them).

It really begs the question of how much disk space are you wasting if
you just copy the figures you want from your usual figures folder to a
sub-folder inside the one containing your main thesis.tex file? Is it
worth this much trouble to save...what...10M, 20M? The .bib file is
negligable (mine seems to be about 90 kb for 120 references).

Harriet wrote:

> My problem is this:
> I keep my bibliography on the pc, in a directory structure as follows:
> c:/documents and settings/myuserid/my documents/references/*.bib
> All my 'reports' (ie conference papers, thesis etc) are stored in:
> c:/documents and settings/myuserid/my documents/reports/thesis/*.txt
>

--
---------------------------------------------------------------------------
Ian Konen
Dept. of Chemistry
Stanford University
iko...@myuniversityname.edu
---------------------------------------------------------------------------

Peter Flynn

unread,
Jul 10, 2002, 8:05:32 PM7/10/02
to
Harriet wrote:
> I use a pc with windows 2000 and have recently installed MikTex and
> WinEdt as I got tired of Word crashing all the time and thought I'd
> better learn how to use latex before I start writing my thesis! I
> have also downloaded bibdb to manage my bibliography of papers read.
> My problem is this:
> I keep my bibliography on the pc, in a directory structure as follows:
> c:/documents and settings/myuserid/my documents/references/*.bib
> All my 'reports' (ie conference papers, thesis etc) are stored in:
> c:/documents and settings/myuserid/my documents/reports/thesis/*.txt
>
> I cannot get my paper, written using winedt, to find the bibliography
> and thereby put in my references when I compile. I have tried all
> sorts of ways of referring to it but it really doesn't like the gaps

What I said five minutes ago on comp.text.xml:

>> ... using spaces in directory and file names is EVIL. It rots your
>> teeth,makes your hair fall out, and brings on premature senility. It
>> starts nuclear wars and makes holes in the ozone layer. It strikes at
>> the very basis of human civilization, and makes people vote for the
>> wrong party. It's wrong, wrong, wrong, wrong, wrong. Avoid them. Stamp
>> them out.

:-)

Use relative names, eg in a document the thesis directory, refer to
../../references/foo.bib.

> I will also have a similar problem when it comes to all my figures and
> diagrams as these are stored in a directory structure (under 'My
> Pictures' another windows default) which tells me exactly which
> experimental configuration which picture came from.
> I am aware that gaps in a directory name are something latex doesn't
> like (I've been searching on the web for solutions) but haven't found
> one that really tells me how to solve this. Can anyone tell me what
> to do?

Relative names will work provided you don't have to ascend above the
first directory back which contains a space in the name.

///Peter


0 new messages