I'm trying to use the \currfiledir command on my homework template, so I can change even less of my header every time I start a new document, see mwe:
\documentclass[letterpaper,12pt]{article}
\usepackage{lastpage}
\usepackage[realmainfile]{currfile}
\author{Brent DeJong}
\title{\currfiledir~\\ Homework ***}
\makeatletter
\let\runauthor\@author
\let\runtitle\@title
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{\runtitle}
\rhead{\runauthor\\ Page \thepage\ of \pageref{LastPage}}
\fancyfoot{}
\begin{document}
\getmainfile
\begin{flushright}
\runauthor \\
\runtitle \\
\today \\
\end{flushright}
\end{document}
Unfortunately, the \currfiledir command returns nothing.
I'm running TeXWorks via a MiXTeX distribution on Windows 8.1, so I don't know how to implement a commandline-based solution for this on my system. I get only the file name if I use \currfilepath or \currfilename. Is this package viable on Windows? How do I take advantage of it?
\currfiledirexpands to nothing for the main file, because there is no complete path available, just the file name. This is confirmed by the fact that\currfilepathjust shows the file name. – egreg Feb 18 '15 at 22:31