How can I redefine \today
so that today's current date comes in the format
May 26th, 2016
I need the "th" to be superscript.
It should come to the bottom right corner of the page. The code does not work when I use it in the following environment XeLaTeX.
% Preamble:
\NeedsTeXFormat{LaTeX2e}
\LoadClass{article}
\usepackage[head=12pt, foot=12pt, top=18mm, bottom=15mm, left=12.7mm, right=12.7mm]{geometry}
\usepackage[absolute]{textpos}
\usepackage[UKenglish]{babel}
\usepackage[en-US]{datetime2}
\DTMlangsetup{ord=raise}
\usepackage{rotating}
% Main Tex:
\begin{document}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\textblockorigin{0mm}{5mm}
\begin{textblock}{60}(205,207)
\begin{turn}{90}
Last Updated on
\today
\end{turn}
\end{textblock}
\end{document}
I need this to come as [Last Updated on May 26th, 2016]. "th / st /nd " raised to superscript height. Rotated 90 Deg. Bottom Right Corner of page. Please Check MWE Link Below.
Also I Keep getting this Warning:
Package datetime2 Warning: Region `english-base' has ignored (datetime2) the following settings: (datetime2) ord=raise on input line 13.
Link to MWE:
https://www.overleaf.com/5308800stsrzk#/16764374/
Best Answer
I suggest you use the datetime2 package with the option
en-US
:The instruction
\DTMlangsetup{ord=raise}
instructsdatetime2
to treat the day number as an ordinal and to raise thest
/nd
/rd
particles to superscript height.Addendum to address the OP's augmented question: It looks like you're using
UKenglish
as the main language option forbabel
, yet also wanting a US-style date string ("May 26th, 2016" -- with "th" raised) rather than a UK-style date string ("26th May 2016" -- "th" not raised). To achieve this objective, you need to (a) provide "USenglish" as a secondary language option when loadingbabel
and (b) execute the instruction\selectlanguage{USenglish}
inside thetextblock
environment.The code shown below should compile equally well under pdfLaTeX, XeLaTeX, and LuaLaTeX.