I input a file inp.txt using its path relative to the directory containing the main.tex file and where I will run pdflatex:
\documentclass{article}
\begin{document}
\input{../inputs/inp.txt}
\end{document}
Is there a way to specify the absolute path of inp.txt, e.g. ~/inputs/inp.txt?
Since I am looking for a general solution to include \includegraphics, \input and \include files I try to use TEXINPUTS and modify my script:
\documentclass{article}
\begin{document}
\input{inp.txt}
\end{document}
When I run
TEXINPUTS=~/inputs pdflatex main.tex
it turns out I have changed my working directory producing the error message:
! I can't find file `filepath.tex'.
Adding multiple paths TEXINPUTS=~/inputs:. produces other problems.
Is there a simple and concise solution?
/users/someone/inputs/inp.txtif you want to use~use\string~otherwise it means nobreak space. – David Carlisle Sep 17 '18 at 11:14:– David Carlisle Sep 17 '18 at 11:21