0
  1. I understand that package currfile provides information on the currently loaded file like name, path, directory, etc. \currfilename and \currfileext deliver as promised, \currfiledir and \currfilepath return blanks. Why?
  2. I am told that the expl3 core now provides its own access to current filename and path. Is this as documented in ltfilehook, dated 17 June 2021? Since \CurrentFile and \CurrentFilePath compile with \usepackage{currfile} commented out, I take it my system is up to date. However, keeping with the tradition, both \CurrentFile and \CurrentFilePath return blanks.

Anyone interested in providing some clues?

\documentclass{article}
% RN. 24 June 2021
%=======================
\usepackage{comment}
\usepackage[check-declarations,log-functions]{expl3}
\usepackage{currfile}
%-----------------------
\begin{document}

\ExplSyntaxOn \verb+\c_sys_jobname_str+ = \c_sys_jobname_str \ExplSyntaxOff

\verb+\currfilename+ = \currfilename

\verb+\currfileext+ = \currfileext

\verb+\currfiledir+ = \currfiledir

\verb+\currfilepath+ = \currfilepath

\verb+\CurrentFilePath+ = \CurrentFilePath

\verb+\CurrentFile+ = \CurrentFile

\end{document}

  • regarding currfile, you want the absdir https://tex.stackexchange.com/a/228928/2388 – Ulrike Fischer Jun 25 '21 at 07:08
  • \CurrentFile is only useful if you use file hooks, then it contains the current file name. – Ulrike Fischer Jun 25 '21 at 07:11
  • @Ulrike Fischer I am using \usepackage[abspath]{currfile} and \currfileabsdir as per your previous post, but still get blanks. – Reinhard Neuwirth Jun 25 '21 at 08:58
  • did you read my complete answer? Including the first sentence? – Ulrike Fischer Jun 25 '21 at 09:05
  • 1
    The paths return empty because TeX doesn't care where in your system you are running your document. \CurrentFile (which is a LaTeX command, you don't need to load expl3) returns empty in the main .tex file because we (as in I) didn't initialise it... Maybe we should... – Phelype Oleinik Jun 25 '21 at 13:13
  • 1
    @Phelype Oleinik Would be great if you would. My requirement may seem a little far-fetched, but I work from a set of template .tex files, in which I have to manually set the path to the directory where my projects reside. Having the system supply me with that path my templates would be automated. Not a big thing, but relocating projects currently is a pain. – Reinhard Neuwirth Jun 25 '21 at 15:03

0 Answers0