Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

KOMA scrlttr2 date customization

2,929 views
Skip to first unread message

Haines Brown

unread,
Dec 30, 2012, 9:33:53 AM12/30/12
to
I have a KOMA-Script template for personal letters set up, but would like to
customize the letter date (\usepackage{scrdate} is in the .lco file).

I have no problem with this customization:

\setkomavar{date}{\todaysname, \ISOToday}

but instead of \ISOToday, I want something like the \dategerman format
so that the date appears like this:

Sunday, 2012.12.30

The \dategerman requires some kind of language specification, but the
KOMA-Script manual looses me. At present I have only:

\setmainlanguage{english}

In (Xe)LaTeX I do something like it with this:

\usepackage[nodayofweek]{datetime}
\renewcommand{\dateseparator}{.}

But I've not been able to use the command in KOMA-Script.

Haines Brown

Axel Berger

unread,
Dec 30, 2012, 6:12:43 PM12/30/12
to
Haines Brown wrote:
> I want something like the \dategerman format
> so that the date appears like this:
> Sunday, 2012.12.30

Two points:
a) That is nothing like any German date format ever used.
b) The "German" date format (30.\,12.~2012) has been illegal in Germany
for decades, as there is a requirement to abide by DIN and ISO
standards, though this has been totally ignored so far, mostly by public
servants, who very obviously consider themselves above the law.

I suggest using ISO or as a second choice some traditional commonly used
format, but NOT an idiosyncratic one you've thought up yourself.

Axel

Haines Brown

unread,
Dec 30, 2012, 10:15:31 PM12/30/12
to
Axel, interesting. In the KOMA-Script manual (en), p. 313, all the date
commands put the date last. This strikes me as odd, if as you say there
is a clear standard in Germany. I hope the "Sunday," prepend does not
violate the ISO standard because, for it just adds info not part of the
date format, similarly to prepending the sender's city. ISO 8601
suggests numbering the week day preceeded by W, but I'm sure that would
confuse most readers. In any case, heeding your advice I'll stick with
ISO 8601 rather than impose period separators.

Thanks,

Haines


GL

unread,
Dec 31, 2012, 2:33:00 AM12/31/12
to
Le 31/12/2012 04:15, Haines Brown a �crit :
> Axel Berger <Axel....@Gmx.De> writes:
>
>> Haines Brown wrote:
>>> I want something like the \dategerman format
>>> so that the date appears like this:
>>> Sunday, 2012.12.30

You may also consider the datetime package by N Talbot,
and the \newdateformat and \newdate commands.

http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/datetime.html

Regards.

Axel Berger

unread,
Dec 31, 2012, 10:10:12 AM12/31/12
to
Haines Brown wrote:
> In the KOMA-Script manual (en), p. 313, all the date
> commands put the date last.

Strange. In mine, version of 2012-05-15, all of them except American
have the order dd mm yyyy. This even seems wrong to me at least for some
cases. The old MS-DOS setups had Norwegian as identical to what now has
become ISO, so either Bill Gates or Markus Kohm has to be wrong.
Normally I'd always go for the former but not in this case.

Axel

GL

unread,
Dec 31, 2012, 11:14:43 AM12/31/12
to
Le 31/12/2012 16:10, Axel Berger a �crit :
Markus Kohm is like an architect who would like to rebuild Babylon on
its own.

Bill Gates is the richest man in the world (for memory...)

Markus Kohm

unread,
Dec 31, 2012, 1:19:34 PM12/31/12
to
Axel Berger (Montag, 31. Dezember 2012 00:12):

> b) The "German" date format (30.\,12.~2012) has been illegal in Germany
> for decades

Nonsense. There's no date law in Germany, so it can't be illegal and the
date format of DUDEN, "Richtlinien für den Schriftsatz" is still:

| Bei Datumsangaben in Ziffern setzt man einen Punkt nach den Zahlen für
| Tag und Monat. Die Jahresangabe steht ohne Punkt.

| Zwischen Tag und Monat wird ein kleiner Zwischenraum, vor dem Jahr ein
| normaler Wortabstand gesetzt.

This is exactly: 31.\,12.~2012

BTW: Most of the numeric date definitions are made by nativ speakers. Norsk
date setting, e.g., was a suggestion of Sveinung Heggen.

A possible english date with day may be:

\documentclass[numericaldate]{scrlttr2}
\usepackage[british]{babel}
\usepackage{scrdate}
\begin{document}
\setkomavar{date}{\todaysname, \today}
\begin{letter}{test}
\opening{Hello}
\closing{Bye}
\end{letter}
\end{document}

or

\documentclass[numericaldate]{scrlttr2}
\usepackage[american]{babel}
\usepackage{scrdate}
\begin{document}
\setkomavar{date}{\todaysname, \today}
\begin{letter}{test}
\opening{Hello}
\closing{Bye}
\end{letter}
\end{document}

or the wanted:

\documentclass[numericaldate]{scrlttr2}
\usepackage[american]{babel}
\newcommand*{\mytoday}{%
\the\year.\ifnum\month<10 0\fi\the\month.\ifnum\month<10 0\fi\the\day
}

\usepackage{scrdate}
\begin{document}
\setkomavar{date}{\todaysname, \mytoday}
\begin{letter}{test}
\opening{Hello}
\closing{Bye}
\end{letter}
\end{document}

Markus Kohm
--
KOMA-Script, a versatile bundle of classes and packages for LaTeX2e
Current: KOMA-Script 3.11b (see <http://www.komascript.de/release> in
German)

Robin Fairbairns

unread,
Jan 1, 2013, 12:34:32 PM1/1/13
to
GL <goua...@gmail.com> writes:

> Le 31/12/2012 16:10, Axel Berger a écrit :
>> Haines Brown wrote:
>>> In the KOMA-Script manual (en), p. 313, all the date
>>> commands put the date last.
>>
>> Strange. In mine, version of 2012-05-15, all of them except American
>> have the order dd mm yyyy.

the year-month-day format has the advantage of being "computer kind".
i'm getting to be more and more computer-like in my old age (e.g., i
crash a lot) and have used that format for ages.

(i find the american format confusing; allegedly, one of the salesmen at
my previous job "lost" a sale because of american format dates.)

>> This even seems wrong to me at least for some
>> cases. The old MS-DOS setups had Norwegian as identical to what now has
>> become ISO, so either Bill Gates or Markus Kohm has to be wrong.
>> Normally I'd always go for the former but not in this case.

i don't think m$'s styles help the argument.

> Markus Kohm is like an architect who would like to rebuild Babylon on
> its own.

he does it quite well, imo. were i still creating latex documents, i
would be using the scr* stuff.

> Bill Gates is the richest man in the world (for memory...)

possibly he was, once, but istm he's giving money away faster even than
a crooked banker, now. if he didn't have m$ on his conscience, he would
be undoubtedly one of the good guys...
--
Robin Fairbairns, Cambridge
sorry about all this posting. i'll go back to sleep in a bit.

GL

unread,
Jan 1, 2013, 12:48:30 PM1/1/13
to
Le 01/01/2013 18:34, Robin Fairbairns a écrit :
> GL <goua...@gmail.com> writes:
>
>> Le 31/12/2012 16:10, Axel Berger a écrit :
>>> Haines Brown wrote:
>>>> In the KOMA-Script manual (en), p. 313, all the date
>>>> commands put the date last.
>>>
>>> Strange. In mine, version of 2012-05-15, all of them except American
>>> have the order dd mm yyyy.
>
> the year-month-day format has the advantage of being "computer kind".
> i'm getting to be more and more computer-like in my old age (e.g., i
> crash a lot) and have used that format for ages.

lol !
My old i7 does not crash so much, much less than my older core-2-duo.

This also means that in your old age, your power doubles each couple of
years, you old devil Robin ! ;-)

Markus Kohm

unread,
Jan 1, 2013, 3:31:45 PM1/1/13
to
Robin Fairbairns (Dienstag, 1. Januar 2013 18:34):

> he does it quite well, imo.

Many thanks. I've had more than 18 years to build and improve KOMA-Script
(more than 10 years with scrlttr2).

rsh

unread,
Jan 7, 2013, 6:03:53 PM1/7/13
to
And I used the recommendation from The Language Council of Norway, (www.sprakradet.no) which obviously has better knowledge of the Norwegian language than most of us. That said, you have several ways to write a date in Norwegian. 13 January can be written:

13.1., 13.01., 13.1.13, 13.01.13, 13.1.2013, 13.01.2013, 13. januar 13 or
13. januar 2013.

Pick and choose.

Sveinung Heggen

Axel Berger

unread,
Jan 9, 2013, 8:34:14 AM1/9/13
to
rsh wrote:
> And I used the recommendation from The Language Council of Norway,

You are of course both right. The setup I actually use in my CONFIG.SYS
is 046=Sweden, not Norway, my mistake.

What remains is a less than optimal choice in Komascript, see
http://en.wikipedia.org/wiki/Date_format_by_country

"National standard format is yyyy-mm-dd;[142] casually many people use
d/m yyyy or d/m -yy. Another possible format is d.m.yyyy.[143]"

I would have preferred the official over the casual format.

Axel

Markus Kohm

unread,
Jan 9, 2013, 9:22:35 AM1/9/13
to
Axel Berger (Mittwoch, 9. Januar 2013 14:34):

> I would have preferred the official over the casual format.

Very easy:

\documentclass{scrlttr2}
\usepackage[swedish]{babel}
\usepackage{scrdate}
\setkomavar{date}{\ISOToday}
\begin{document}
\begin{letter}{you\\there}
\opening{Hi}
0 new messages