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 trying to set the documentclass type of a certain .tex file to be a class that is in the parent folder. However, I'm not sure how to include the path to the .cls file. I can write

\documentclass[letterpaper,12pt]{../foo}

But that complains that the imported class isn't the same as the provided class (in foo.cls I have \ProvidesClass{foo}. I know that this is just a warning and I could ignore it, or I could write \ProvidesClass{../foo}, but was wondering if there was a cleaner way to do the document class declaration.

share|improve this question
    
I don't think you can use a path when selecting the \documentclass. Instead you should change the search path so it can be found. –  Peter Grill Sep 4 '11 at 3:25
    
A path does seem to work, though. Or is that only guaranteed to work in certain environments? (I'd rather not place them in some central folder since each is only relevant to a certain group of work) –  Jamie Sep 4 '11 at 3:28
    
I belive that the document class that is expected will be ../foo and not foo when you use it as \documentclass{../foo}. Perhaps you could try changing the class name to ../foo but I think that is a bad idea. –  Peter Grill Sep 4 '11 at 3:39
    
Yes, as I mentioned in my question, changing the provides "../foo" will work, but it does seem a bit ugly. –  Jamie Sep 4 '11 at 3:50
    
I meant use \documentclass{foo} and change the search path so that TeX can locate it. ie., Place the file in ~/texmf/tex/latex/, and run texhash to update the TeX database. I haven't tried it but it should work. –  Peter Grill Sep 4 '11 at 3:59

1 Answer 1

You can use the TEXINPUTS environment variable to locally change the search paths.

Unix

Run

export TEXINPUTS="..:"

before your LaTeX commands. Or set the variable only for one command:

TEXINPUTS="..:" pdflatex …

Windows

Run

set TEXINPUTS="..;"

to set the environment variable in a current command line shell or batch file session.

share|improve this answer

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.