# Renaming date in revtex4

I found the similar question and answer for renaming some of the keywords, but they were for revtex4-1. Since my document is giving me strange errors when I'm using revtex4-1, and not when I'm using revtex4, this solution didn't help.

I also found a documentation about revtex4 and there I found this:

The optional argument allows the user to override the text that will be typeset along with the date; the default value of that text is itself a localized macro.

1156\renewcommand*\date[2][\Dated@name]{\def\@date{#1#2}}%
1157\def\@date{}%


But this isn't working (or I don't understand how to use this)

Here's the 'mwe'

\documentclass[onecolumn,prb,floats,amsmath,amssymb,superscriptaddress,nofootinbib,12pt]{revtex4}

\usepackage{graphicx}
\usepackage{bm}
\usepackage[croatian]{babel}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{extarrows}
\usepackage{subfigure}
\usepackage{caption}
\usepackage{mathtools}
\usepackage{bbm}
%\usepackage{float}
\usepackage{psfrag}
\usepackage{url}
\usepackage[all]{hypcap}
\usepackage{subfigure}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{listings}
\usepackage{array}
\usepackage[paperwidth=210mm,paperheight=297mm,centering,hmargin=2cm,vmargin=2.5cm]{geometry}
\usepackage{enumitem}
\setlist{nolistsep}
\makeatletter
\gdef\@ptsize{0}% 10pt documents
% or:
%\gdef\@ptsize{1}% 11pt documents
%\gdef\@ptsize{2}% 12pt documents
\let\@currsize\normalsize
\makeatother
\usepackage{setspace}
\onehalfspacing

\renewcommand*\date[2][\Dated@name]{\def\@date{#1#2}}%
\def\@date{Datum:}%

\makeatletter
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\makeatother

\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}

\newcolumntype{y}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\renewcommand*{\arraystretch}{1.2}

\begin{document}

\title{Random title}
\author{Random guy}
\affiliation{Random place, 99999 Randomville}
\date{\today}

\begin{abstract}

\end{abstract}

\maketitle

\begingroup
\tableofcontents
\endgroup

\section{Intro}

\section{Bla}

\subsection{Bla1}

\section{Bla!}

\end{document}

• At least you need to do the \renewcommand*\date[2]{...} and \def\@date{Datum:} between \makeatletter and \makeatother – egreg Jul 3 '13 at 13:33

You don't need to redefine \date, but only \Dated@name. Since this is an @-command, you need to enclose it between \makeatletter and \makeatother:

\makeatletter
\def\Dated@name{Datum: }
\makeatother


Minimal example:

\documentclass[onecolumn,prb,floats,amsmath,amssymb,superscriptaddress,nofootinbib,12pt]{revtex4}

\makeatletter
\def\Dated@name{Datum: }
\makeatother

\begin{document}

\title{Random title}
\author{Random guy}
\affiliation{Random place, 99999 Randomville}
\date{\today}

\begin{abstract}

\end{abstract}

\maketitle

\section{Bla}

\end{document}


The easiest way is to simply use

\date[Today: ]{\today}


The text within the square bracket replaces the "Dated" in revtex4-1 class. Enjoy!