Document ClassesBeamer + datetime

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
remusmp
Posts: 25
Joined: Sat Oct 17, 2009 8:37 pm

Beamer + datetime

Post by remusmp »

Hi,

I have noticed a "bug". It can be reproduced in this way:
- beamer used in conjunction with datetime package;
- the title of the presentation contains \today;
- view the properties of the pdf document (File-Properties in Adobe Reader) and strange numbers appears instead of the current date;
- if datetime package is omitted, everything works.

Here is a sample code (pdflatex):

Code: Select all

\documentclass{beamer}
\usepackage{datetime}
\title{\today}
\begin{document}
\frame{
	\maketitle
}
\end{document}
If you know a workaround or a fix, please tell me :)

I am using datetime because I want to show the current date in this format: day.month.year (numerically). For example: 24.11.2010. If you a know a way to do it without datetime package, please let me know.

Thanks.
Remus.

PS: In properties this string appears: ===by 400by 400 by -==by 100by 100 by -==by 4by 4 by -=0===by =by -1901=by 28by 28 by -=by 4by by 2=by 7by 7 by -by by -1=by 7by 7 by -by 1 === [], 0
Last edited by remusmp on Fri Nov 26, 2010 12:46 pm, edited 1 time in total.

Recommended reading 2024:

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

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

remusmp
Posts: 25
Joined: Sat Oct 17, 2009 8:37 pm

Beamer + datetime

Post by remusmp »

I am using this workaround for now:

Code: Select all

\number\day.\number\month.\number\year
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Beamer + datetime

Post by nlct »

Unfortunately the datetime definition of \today doesn't expand to a simple string, which is what's causing the problem, so you'll need to use \texorpdfstring to provide an alternative.

Code: Select all

\title{\texorpdfstring{\today}{\number\day.\number\month.\number\year}}
Alternatively, you could do:

Code: Select all

\documentclass{beamer}
\let\orgtoday\today
\usepackage{datetime}
\title{\texorpdfstring{\today}{\orgtoday}}
\begin{document}
\frame{
   \maketitle
}
\end{document}
Regards
Nicola Talbot
Post Reply