3

Hi this is the preamble I have used

\documentclass[prd,aps,superscriptaddress,twocolumn,10pt]{revtex4-1}
\usepackage{times}                          
\usepackage[a4paper, left=1.85cm, right=1.85cm,top=1.85cm, bottom=1.85cm]{geometry}       
\usepackage[font=small,labelfont=bf]{caption}                      
\usepackage{graphics,graphicx,epsfig,ulem}  
\usepackage{amsmath}                        
\usepackage{etoolbox}                       

\makeatletter
\patchcmd{\frontmatter@RRAP@format}{(}{}{}{}
\patchcmd{\frontmatter@RRAP@format}{)}{}{}{}
\renewcommand\Dated@name{}
\makeatother

\usepackage{fancyhdr}
\pagestyle{fancy} 
\date{Submitted: \today{}, Date of Experiment: \nth{11} December 2018}       

It's the end part I need help with

\date{Submitted: \today{}, Date of Experiment: \nth{11} December 2018}

As you can see I have done \nth{11} December 2018 which works fine I was just wondering if there is a way to add that to the \today{} because I can't seem to do it :( Please help I'm new to Latex

4

The datetime2 along with the fmtcount package allows you to easily create new date formats, and it has an ordinal date command. It also allows you to create named dates for display. I've done this for the experiment date.

\documentclass{revtex4-1}
\usepackage{fmtcount}% required in addition to datetime2
\usepackage[calc]{datetime2}
\DTMnewdatestyle{usvardate}{%
\renewcommand{\DTMdisplaydate}[4]{%
  \DTMmonthname{##2} \protect\ordinalnum{##3}, \number##1 }%
 \renewcommand{\DTMDisplaydate}{\DTMdisplaydate}%
}
\DTMsetdatestyle{usvardate}
\DTMsavedate{expdate}{2018-12-11}

\date{\today{}. Date of experiment: \DTMusedate{expdate}}
\usepackage{etoolbox}                       

\makeatletter
\patchcmd{\frontmatter@RRAP@format}{(}{}{}{}
\patchcmd{\frontmatter@RRAP@format}{)}{}{}{}
\renewcommand\Dated@name{}
\makeatother

\begin{document}
\maketitle
\end{document}

enter image description here

  • I know the comment says to avoid saying thanks but thank you :) – Cinna Dec 22 '18 at 19:06
  • @mavihs26 You're welcome. If the answer solved your problem, it's helpful to "Accept" it by clicking on the green checkmark beside is. – Alan Munn Dec 22 '18 at 19:49
  • Hi there is actually a small issue with what you sent although it works when I write \maketitle it's coming up with an ! error message on the side. How can i remove this ? Package datetime2-calc Warning: Can't find underlying language macro for \DTMmonthname (language: english); using pgfcalendar macro instead on input line 69. – Cinna Dec 23 '18 at 3:02
  • @mavihs26 It's not really an error, but a warning, and can safely be ignored. You can remove the warning completely by loading babel with the [english] option. – Alan Munn Dec 23 '18 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.