Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using \formatdate from datetime, I can get a date properly formatted in multiple languages:

\formatdate{3}{4}{2012}

However, I would like to only use the day and month and leave the year behind. I've tried passing:

\formatdate{3}{4}{\empty}

but it doesn't work, as it expects a number.

How could I achieve that?

share|improve this question
1  
This is because datetime stores the day/month/year in counters. –  Werner Sep 13 '12 at 19:59

1 Answer 1

up vote 6 down vote accepted
\makeatletter

\def\formatdateny{\csname noyear\languagename\expandafter\endcsname\formatdate}
\def\noyearenglish#1, \the\@year{#1}
\let\noyearamerican\noyearenglish
\let\noyearbritish\noyearenglish
\def\noyearfrench#1\space\number\@year{#1}
\let\noyeargerman\noyearfrench
\let\noyearaustrian\noyeargerman
\let\noyearswedish\noyearfrench
\let\noyearbreton\noyearfrench
\def\noyearrussian#1\ \number\@year~\cyrg.{#1}
\def\noyearspanish#1\ de~\number\@year{#1}
\let\noyearcatalan\noyearspanish
\def\noyearbasque#1\number\@year.eko\space{#1}
% etc.

\makeatother


 \formatdateny{3}{4}{2012}
share|improve this answer
    
Wonderful, thanks! Just have to mix it with your previous answer to make it expandable ;-) –  ℝaphink Sep 13 '12 at 20:02
    
actually it works for french but not english, update in a bit –  David Carlisle Sep 13 '12 at 20:03
    
Ah, so I'll have to declare all supported languages I guess… –  ℝaphink Sep 13 '12 at 20:19
    
Also, could you explain how it works please? :-) –  ℝaphink Sep 13 '12 at 20:21
    
Oh, I get it now. But English doesn't work for me still. –  ℝaphink Sep 13 '12 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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