Created
July 3, 2021 19:06
-
-
Save JohnLukeBentley/9dda6166b9ee5c4127afd2b8cd16b70a to your computer and use it in GitHub Desktop.
Testing etoolbox's AtEndPreamble command to reference author, title, date declared at bottom of a preamble.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt,a4paper]{article} | |
\usepackage{lipsum} | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Margin Start | |
\RequirePackage{fancyhdr} | |
\pagestyle{fancy} | |
% clears the header and footer | |
\fancyhf{} | |
% Keeps header and footer same size text when adjusting margins | |
\fancyhfoffset{0pt} | |
\usepackage{etoolbox} % For \AtEndPreamble | |
% Keep \makeatletter and \makeatother out of \AtEndPreamble{} | |
\makeatletter | |
\AtEndPreamble{% | |
\let\runauthor\@author | |
\let\runtitle\@title | |
\let\rundate\@date | |
\lhead{\it\runtitle} | |
\rhead{\it\runauthor} | |
\lfoot{\it\rundate} | |
\rfoot{\it\thepage} | |
} | |
\makeatother | |
% Margin End | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
\author{Joe Blow} | |
\title{Great Work} | |
\date{2021-07-04} | |
\begin{document} | |
\maketitle | |
\lipsum[1-10] | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment