When writing my own class in a subdirectory, e.g. myclass/aclass.cls, and I use the currfile package to load that class's current file path, it always returns the information of my main file only. Could someone please tell me what I am doing wrong or if it's not even possible to do?
Here is an example:
TeX sample tree
.
├── myclass
│ └── aclass.cls
├── test.pdf
└── test.tex
test.tex
\documentclass{myclass/aclass}
\begin{document}
\section{Class file: \aclassfile}
\end{document}
myclass/aclass.cls
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{aclass}
\LoadClass[a4paper, 12pt]{article}
\RequirePackage{currfile}
\edef\aclassfile{\currfilepath}
test.pdf

\documentclass{myclass/aclass}do\documentclass{aclass}and arrange that that file is in your TEXINPUTS path. The argument todocuemntclassshould be a class name not a file path – David Carlisle Jul 10 '14 at 20:16aclass.clsinto the main dir, it also doesn't resolve the right filepath. – Konstantin Möllers Jul 10 '14 at 20:21