Graphics, Figures & TablesSeparate directory for tables, similar to \graphicspath?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
arwintcher
Posts: 29
Joined: Thu Feb 19, 2009 3:23 pm

Separate directory for tables, similar to \graphicspath?

Post by arwintcher »

I'm trying to work out whether I can create a subdirectory for all of my tables and use it in a similar way to \graphicspath, that is, by defining it in the preamble and not having to deal with it again. I have a lot of tables for my thesis and the directory is really cluttered, so it would be nice from an aesthetic point of view if not strictly necessary.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Separate directory for tables, similar to \graphicspath?

Post by phi »

A simple solution would be to define a new command:

Code: Select all

\newcommand*\InputTable[1]{\input{./tables/#1.tex}}
Then you can say

Code: Select all

\InputTable{abc}
to include the contents of the file "./tables/abc.tex".
Another hint: It is generally better to set the TEXINPUTS environment variable instead of using \graphicspath.
arwintcher
Posts: 29
Joined: Thu Feb 19, 2009 3:23 pm

Re: Separate directory for tables, similar to \graphicspath?

Post by arwintcher »

Hey, that works really well. Thanks a lot. :D
Post Reply