\file_if_exist:nTF searches the TeX/LaTeX input path for the filename given as an argument. Now I am looking for a way to get hands on the complete path to the file, in case it was found. From the LaTeX2e command \IfFileExists I know that it stores the path to the file in the macro \@filef@und. I wonder if there is a LaTeX3 counterpart to \@filef@und. If not, I kindly ask the LaTeX3 developers to provide a such, because it may come in handy in certain programming tasks.
Tell me more
×
TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
|
|
||||
| show 2 more comments |
|
I have just added to the development version of
which will result in the (storage macro) containing either:
I've also adjusted the other file code to make use of this. The idea is that you can save doing the file test if you know you'll need to use the path, by doing
but unlike LaTeX2e this is documented and therefore officially-supported. This will go to CTAN with the next update: let me know if this is urgent (I do the releases 'from time to time'). |
|||
|
\@filef@undis clearly an abuse of\IfFileExist. I wonder if you can give a good example where the path is needed outside of the file loading routine? – Joseph Wright♦ Apr 12 '11 at 7:40\IfFileExistand\file_if_exist:nTFare not file loading but file locating routines. Hence, it is up to the user (or package author) to decide what to do with the information gained. One possible use is related to thelatex->dvips->ps2pdfworkflow. A LaTeX package may contain raw Postscript file reading/writing operators in its code. LaTeX and Ghostscript don't necessarily evaluate the same search paths and the Ghostscript search path cannot be set from within the LaTeX document. (to be continued) – AlexG Apr 12 '11 at 8:32\file_get_path:nN, returning\q_no_valueif the file is not found? – Joseph Wright♦ Apr 12 '11 at 14:29