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.

I use the \today comment, then it produces den 26th February. However I want den 26ten Februar. How can I change that?

share|improve this question
5  
Actually »babel« with its language option ngerman should already do the trick. But you can also have a look at »isodate«. For more than these assumptions you should provide a self-contained and minimal example. –  Thorsten Donig Feb 26 at 16:56
    
seems \usepackage[ngerman]{babel} does not work for me. –  Ginger Feb 26 at 16:58
    
@Ginger You should post a minimal working example (MWE), so people can determine what is not working for you... –  Jubobs Feb 26 at 17:30
    
There is also package datetime. –  John Kormylo Feb 26 at 17:33
6  
The question was already answered, but as a native German speaker I have to say, that it is really unusual to write '26ten' or anything which resembles that. It should be written '26. Februar'. –  Christian Hupfer Feb 26 at 17:44

1 Answer 1

Try with the datetime package, by defining a new date format:

\newdateformat{myformat}{\THEDAY{ten }\monthname[\THEMONTH], \THEYEAR}

MWE:

\documentclass{article}

\usepackage[ngerman]{babel}
\usepackage{datetime}

\newdateformat{myformat}{\THEDAY{ten }\monthname[\THEMONTH], \THEYEAR}

\begin{document}

\myformat\today

\end{document} 

Output:

enter image description here


EDIT

If you can't load babel with the language ngerman, you can however load datetime as

\usepackage[ngerman]{datetime}

and define the date format as

\newdateformat{myformat}{\THEDAY{ten }\monthnamengerman[\THEMONTH], \THEYEAR}

MWE:

\documentclass{article}

\usepackage[english]{babel}
\usepackage[ngerman]{datetime}

\newdateformat{myformat}{\THEDAY{ten }\monthnamengerman[\THEMONTH], \THEYEAR}

\begin{document}

\myformat\today

\end{document} 

Output:

enter image description here

share|improve this answer
    
thanks@karlkoeller, but because i already have \usepackage[english]{babel}, then i cannot add \usepackage[ngerman]{babel}. If I do this\PassOptionsToPackage{english,ngerman}{babel}, Februry is still in English. –  Ginger Feb 26 at 20:37
    
@Ginger Instead of \PassOptionToPackage, use \selectlanguage{ngerman} immediately after \begin{document} - –  Sveinung Feb 26 at 23:21
    
@Ginger See the edited answer. –  karlkoeller Feb 27 at 6:15
2  
@Ginger: Although this seems to answer the question, this is formally completely wrong (as already mentioned in the comments to the questions). In German we don't write dates in this way. Mark my words! –  Thorsten Donig Feb 27 at 15:56

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.