[OS X TeX] day of week in LaTeX for an arbitrary date

Ramón Figueroa-Centeno ramonf at hawaii.edu
Sun May 3 00:36:17 EDT 2009


Aloha,

> Haven't followed this thread but have you tried datetime?

Thanks! The datetime package works as expected, whereas the weekday and
datenumber packages do not generate the name of the day of the week
correctly! See the following three examples:

1. datetime (correctly gives "Friday, May 1, 2009"):

\documentclass{article} 

\usepackage{datetime}

% \changedate{month}{day}{year} changes the LaTeX date
\newcommand{\changedate}[3]{
\renewcommand{\month}{#1} 
\renewcommand{\day}{#2} 
\renewcommand{\year}{#3}
}
% Change the \today command to show the day of the week
\renewcommand{\today}{\dayofweekname{\day}{\month}{\year}, \monthname\ \day,
\year}

\begin{document} 

\changedate{5}{1}{2009}

\today

\end{document} 

2. weekday (incorrectly gives "Saturday, May 1, 2009"):

\documentclass{article} 

\usepackage{weekday}

\begin{document} 
 
\weekdaydate{2009}{05}{01}

\end{document} 

3. datenumber (incorrectly gives "Saturday, May 1, 2009"):

\documentclass{article} 

\usepackage{datenumber}

% \changedate{month}{day}{year} changes the LaTeX date
\newcommand{\changedate}[3]{
\renewcommand{\month}{#1} 
\renewcommand{\day}{#2} 
\renewcommand{\year}{#3}
}
% Change the \today command to show the day of the week
\renewcommand{\today}{\datedayname, \datemonthname\ \day, \year}

\begin{document} 

\changedate{5}{1}{2009}

\today

\end{document} 

Ramón
-- 
View this message in context: http://n2.nabble.com/day-of-week-in-LaTeX-for-an-arbitrary-date-tp2771836p2773703.html
Sent from the MacOSX-TeX mailing list archive at Nabble.com.




More information about the MacOSX-TeX mailing list