redefine date format in letter environment

Haines Brown haines at histomat.net
Wed Dec 7 16:53:15 CET 2022


On Wed, Dec 07, 2022 at 04:13:58PM +0100, Julius Müller wrote:
> 
> Am 07.12.22 um 14:30 schrieb Haines Brown:
> > I want today's date to appear: 2022.21.07 rather than 2022.21.7
> > 
> > \documentclass[letterpaper,12pt]{letter}
> > 
> > \usepackage{fontspec}
> > \usepackage{libertinus-otf}
> > 
> > \def\mydate{\leavevmode\hbox{\the\year.\twodigits\month.\twodigits\day}}
> > \def\twodigits#1{\ifnum#1<10 0\fi\the#1}
> > \renewcommand*\today{\number\year.\number\month.\number\day}
> 
> As Lars Madsen already pointed out, you need to use the \twodigits macro
> within \today if you want the two digits form, for example by making use
> of the \mydate macro you just defined:
> 
> \renewcommand*\today{\mydate}

I didn/t see in Lars' post this replacement for my original line 
\renewcommand*\today{\number\year.\number\month.\number\day} 

When I made this replacement the date display as I wanted. Thank you.

-- 

     Haines Brown 
 /"\
 \ /  ASCII Ribbon Campaign
  X    against HTML e-mail 
 / \



More information about the texhax mailing list.