In the preamble of my tex document I can set graphicspath. Is it also possible to set a path to sub sections and tables, so I can do \input{relative-path/filename.tex} from any tex file and move that text file to any location?
I am not trying to import a package.
I want to be able to go from this directory structure:
images/image1.png
figures/figure1.tex
tables/table1.tex
section1/filename.tex
main.tex
To this directory structure (i.e. change the location of filename.tex to a sub directory or move it to the root directory):
chapter1/images/image1.png
chapter1/figures/figure1.tex
chapter1/tables/table1.tex
chapter1/section1/filename.tex
chapter1/main.tex
It will break, if main.tex contains \input{chapter1/filename.tex}. Can I avoid manually having to change that to \input{chapter1/section1/filename.tex} upon changing the directory structure?
\input{relative-path/filename.txt}anyway without any preamble setup? – David Carlisle Oct 22 '15 at 19:50\graphicspath{{subdir1/}{subdir2/}{subdir3/}...{subdirn/}}– Wamseln Oct 22 '15 at 19:55\input{filename}having specified the path in the preamble, Actually latex has that facility for\inputand\includegraphicsjust locally uses it, there is an existing answer somewhere I'll find it... – David Carlisle Oct 22 '15 at 19:55\graphicspath(\input@path) but simply use\input{file}or\includegraphics{file}and make sure that the file is in a directory in your TEXINPUTS then it works from anywhere just as\documentclass{article}always findsarticle.cls– David Carlisle Oct 22 '15 at 20:02\graphicspath{{subdir1/}{subdir2/}{subdir3/}}and all you have to do then is to use\includegraphics{graphic1.png}or\includegraphics{graphic2.png}. These files will be found no matter in which of the specified subdirectories the included graphics are, hence you are able to move them around, but: they have to be in one of the specified directories. – Wamseln Oct 22 '15 at 20:25\graphicspathworks (I wrote that command) but it doesn't have anything to do with "absolute paths". but anyway as i say above the underlying mechanism is implemented for\input,\includegraphicsjust locally redefines the path to use a different path for image files. – David Carlisle Oct 22 '15 at 20:35\includegraphicsmight be sufficient. But since one can also use absolute paths in\graphicspath, it might come in very handy if you want to do something like:\graphicspath{{/absolute/path/to/directory1/}{/absolute/path/to/a/completely/different/directory2/}{/absolute/path/to/yet/another/completely/different/directory3/}}. But of course, I must confess being guilty of not having understood the matter sufficiently before commenting. – Wamseln Oct 22 '15 at 20:49TEXINPUTS=.//:. Not sure where to add it. I will try it before I begin the document. Maybe I should have stuck to Word+Endnote after all :) Oh dear... – tommy.carstensen Oct 23 '15 at 00:10