6

My boss insists that every document I give him must have the file path to that document at the bottom of the last page. No problem with MS Word, but I don't have a clue how to do this in Latex. At the moment, I am putting a footnote at the end of the document to do this. I thought about special footers but I don't know how to change the footer of just the last page.

2 Answers2

5

To improve the solution we need to know what class you are using and if one side or two side printing.

\documentclass{report}
\usepackage{lipsum} % dummy text

\makeatletter

\def\fullpath{\begingroup\everyeof{\noexpand}\@sanitize
  \edef\x{\@@input|"find `pwd` -name \jobname.tex" }%
  \edef\x{\endgroup\noexpand\zap@space\x\noexpand\@empty}\x}

\def\ps@path{
\def\@oddfoot{\texttt{\fullpath}\hfil\thepage}
\def\@evenfoot{\texttt{\fullpath}\hfil\thepage}
}
\makeatother
\AtEndDocument{\thispagestyle{path}}

\begin{document}

\lipsum[1-10]

\end{document}

ps: \fullpath command taken from an @egreg post and requires pdflatex -shell-escape.

Sigur
  • 37,330
-1
\documentclass{report}
\usepackage{lipsum} % dummy text
\makeatletter
\def\ps@path{
   \def\@oddfoot{\texttt{text that I want to be here}\hfil\thepage}
   \def\@evenfoot{\texttt{text that I want to be here}\hfil\thepage}
}
\makeatother
\AtEndDocument{\thispagestyle{path}}
\title{how to put text at the bottom of the last page}
\begin{document}
\lipsum[1-10]
\end{document}