[Tex/LaTex] Including a relative path to a class file

filesystem-access

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.

Best Answer

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.