# Adding “Last updated on” in XeLaTex article

I am writing an article in XeLaTeX and I want to put a note on the bottom of the last page (may be in footer). This is what I have done-

\documentclass[a4paper,10pt]{article}
\usepackage{xcolor}
\newcommand\updateinfo{\hfill\scriptsize\color{gray} Last updated on \today}

\begin{document}
The very long content goes here. The very long content goes here.
\updateinfo %Last updated on \today
\end{document}


However, this is not gonna work as I want, since it is not positioning the text on the bottom. Please have a look.

• Please supply only working examples. This one is missing a \usepackage{xcolor}. – Pieter van Oostrum Nov 30 '16 at 10:32
• @PietvanOostrum: Done. – Ravi Joshi Nov 30 '16 at 10:55

You need a \vfill to push the text to the bottom. Like

\newcommand{\updateinfo}[1][\today]{\par\vfill\hfill{\script‌​size\color{gray}Last updated on #1}}


And note that the date given will be the date that you run LaTeX on it, which isn't necessarily the date of the last update. You can thus add an optional argument to specify another date:

\documentclass[a6paper]{scrartcl}
\usepackage{xcolor}

\newcommand{\updateinfo}[1][\today]{\par\vfill\hfill{\scriptsize\color{gray}Last updated on #1}}

\begin{document}
Without argument
\updateinfo
\newpage
With argument
\updateinfo[November 24, 1991]
\end{document}


• Thanks a lot. I understand your concern. I am gonna make the date as an argument to this function, where the default is \today – Ravi Joshi Nov 30 '16 at 10:57
• \newcommand{\updateinfo}[1][\today]{\par\vfill\hfill{\scriptsize\color{gray}Last updated on #1}} should be what you're looking for. – ebosi Nov 30 '16 at 11:10
• @piet I hope you don't mind I incremented on your answer... – ebosi Nov 30 '16 at 11:14
• @ebo Thanks for the addition. I will get the reputation anyway :) – Pieter van Oostrum Nov 30 '16 at 11:17