I'm trying to create an automatic chapter head which displays the day of the week and date (kind of like a diary entry) I have a directory called "august" within which is a file called 01.tex. The parent file 08.tex (08 for August) calls for 01.tex. see my WME
main file 08.tex:
\documentclass{memoir}
\usepackage[parent]{currfile}
\let\ordinal\relax
\usepackage[dayofweek]{datetime}
\newcommand{\diarydate}{\formatdate{\currfilebase}{\parentfilebase}{2014}}
\begin{document}
\input{08/1.tex}
\end{document}
08/1.tex:
\chapter{\diarydate}
The errors I get:
./08/1.tex:1: Use of \@chapter doesn't match its definition. [\chapter{\lauddate}] ./08/1.tex:1: Argument of \@gobbletwo has an extra }. [\chapter{\lauddate}] ./08/1.tex:1: Paragraph ended before \@gobbletwo was complete. [\chapter{\lauddate}]
\DeclareRobustCommandinstead\newcommad. – wipet Aug 07 '14 at 03:04\DeclareRobustCommandfor macros which are used in titles of chapters, sections. For normal macros, the\newcommandis sufficient. LaTeX isn't my business; you can read more about this in LaTeX manuals. – wipet Aug 13 '14 at 06:32