GeneralDate is Not printing

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
gpn
Posts: 11
Joined: Thu Oct 15, 2009 11:22 am

Date is Not printing

Post by gpn »

Please look the below .tex file and generate PDF using pdflatex.
Here the problem is, it displays the text “date” instead of the actual date. How to print the actual date?

Code: Select all

\documentclass{article}
\usepackage[margin=1.0in]{geometry}
\usepackage[pdfstartview=FitH,unicode]{hyperref}
\usepackage{graphics}
\date{November 22, 2000}
\begin{document}
Hiiiiiiiiiiiiiiiiiiiiiiiii \\
Date is: \@date
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Re: Date is Not printing

Post by php1ic »

Use \today to get the current date.
gpn
Posts: 11
Joined: Thu Oct 15, 2009 11:22 am

Date is Not printing

Post by gpn »

php1ic wrote:Use \today to get the current date.
Thanks for the response
I want to print a particular date (not todays date). I am not sure, whether I am missing any thing in the code.
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Date is Not printing

Post by php1ic »

The problem may be that \date is reserved by the class file. I have had no experience using \@ so don't know what it does, but I guess you are trying to redefine \date. Try this

Code: Select all

\documentclass{article}
\renewcommand{\date}{November 22, 2000}
\begin{document}
Date: \date
\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Date is Not printing

Post by Stefan Kottwitz »

Hi gpn,

if you want to access \@date, use \makeatletter:

Code: Select all

Date is: \makeatletter\@date\makeatother
Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Date is Not printing

Post by localghost »

For general access.

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[margin=1.0in]{geometry}

\author{gpn}
\title{How to access the date}
\date{November 22, 2000}

\makeatletter
\let\Title\@title
\let\Author\@author
\let\Date\@date
\makeatother

\begin{document}
  \noindent
  Title is: \Title\\
  Author is: \Author\\
  Date is: \Date\\
\end{document}

Best regards and welcome to the board
Thorsten¹
Post Reply