I am trying to solve an input issue with the use of the import package but I still have the error it was supposed to solve. So I suppose I don't use it correctly.
Minimal example
arborescence
test.tex
/style_files/pstricks-base/latex/pstricks.sty
/style_files/pstricks-base/generic/pstricks.tex
/style_files/pstricks-base/generic/pst-fp.tex
Files
The pstricks files are from the pstrick-base package. All those files are present in /style_files/pstricks-base.
test.tex
\documentclass{beamer}
\usepackage{import}
\import{style_files/pstricks-base/generic/}{pstricks}
\makeatletter
\def\input@path{{style_files/pstricks-base/latex/}{style_files/pstricks-base/generic/}}
\makeatother
\usepackage{pstricks}
\begin{document}
\begin{frame}
Hi !
\end{frame}
\end{document}
Error
When I run pdflatex test.tex I get
(./style_files/pstricks-base/generic/pstricks.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/pst-xkey.tex
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex))))
! I can't find file `pst-fp.tex'.
<to be read again>
\def
l.47 \def
\XKV@ch@ckch@ice#1#2#3{% bugfix for xkeyval
When I change (line 44 of pstricks.tex)
\ifx\PSTFPloaded\endinput\else\input pst-fp.tex\fi
to
\ifx\PSTFPloaded\endinput\else\input style_files/pstricks-base/generic/pst-fp.tex\fi
the error changes to the next \input issue.
I tought using import would correct that but apparently not. What is the correct way to use import here ?
More context
In case my global approach is not the good one, I describe here what I want to do. Any advice are welcome.
I have a presentation created on Overleaf I want to be able to create directly from my computer. So I have to have some packages present on Overleaf but not on my computer.
However, I don't want to install them and I want to put them into the style_files folder. That's why I use \def\input@path to import the packages even if I read that's not the optimal way.
\importor\input, but with\usepackage. The point of packages is to be reusable, so they are not supposed to be tied to one project, and if they are modified, I'd just put all the modified files (just those) in the same folder as your.texfile. Are yours modified? Why don't you want to install the packages? If you want them only accessible to your user you can put them in e.g,~/texmf/tex/latex. Last resort you can set the TEXINPUTS variable, but I wouldn't. – frabjous Jun 07 '22 at 15:47I know packages are not meant to be tied to one project but as I work on more than one computer it would be easier for me to tie them to this project and not install the packages every time I change the computer. I know it's not the best practice in general, but in that case, it's easier for me.
I don't understand your question about modified files. I only modify the equivalent of test.tex file.
– Ccile Jun 07 '22 at 17:44\importin the mwe, which is a wrapper to\input. Don't do that. How many computers are you switching between that you can't just install the packages on all of them? pstricks isn't exactly some obscure package you'd only ever use once. If you really must, look at the solutions here, or set TEXINPUTS when you compile, or create a symlink from inside ~/texmf/tex/latex to the folder in question. – frabjous Jun 07 '22 at 18:55Thanks for your answers
– Ccile Jun 08 '22 at 08:43