Latest news 2024-03-02: Ebook sale (3rd–9th March 2024): short story cybercrime fiction Unsocial Media free; short story noir crime fiction I’ve Heard the Mermaid Sing free; crime fiction novel The Private Enemy US$1.99; illustrated children’s story The Foolish Hedgehog US$0.99. For further details, see latest blog post.

Bug Tracker RSS feed

I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)

ID 13🔗
Date: 2013-01-07 20:16:28
Status Closed (Fixed)
Category datetime
Version 2.58
Summary name-clash (\ifleapyear / \@modulo) with macros of packages datetime and datenumber

Sign in to subscribe to notifications about this report.


Hello, the minimal exmple above delivers a bunch of errors:
| ! You can't use `the character 8' after \advance.
| <inserted text> 8
|                  038
| l.3 \setstartyear{1991}
| ? 
| ! LaTeX Error: Missing \begin{document}.
| See the LaTeX manual or LaTeX Companion for explanation.
| Type  H <return>  for immediate help.
|  ...                                              
| l.3 \setstartyear{1991}
| ? 
| Missing character: There is no 0 in font nullfont!
| Missing character: There is no 3 in font nullfont!
| Missing character: There is no 8 in font nullfont!
| Missing character: There is no b in font nullfont!
| Missing character: There is no y in font nullfont!
| Missing character: There is no - in font nullfont!
| ! Missing number, treated as zero.
| <to be read again> 
|                     \global 
|  l.3 \setstartyear{1991}
|  ? 
According to the log-file
Package: datenumber 2001/08/06v0.02
Package: datetime 2010/09/21 v2.58 Date Time Package
were in use.

Within the package datenumber everything is defined in terms of \def .

Thus within the example below - right before calling the package datenumber - I locally redefined \def to also \show the meaning of the command in question before defining it:


This way I found out that there are name-clashes with names of the packages datenumber and datetime.

E.g., the control-sequences \ifleapyear and \@modulo were alredy defined by datetime and the package datenumber silently overrode them.

In package datenumber \ifleapyear (and \ifvaliddate) seems to be a macro. Macro-names should not begin with \if... in order to avoid confusion with real \if..-condition-switches defined in terms of \newif.

I suggest either of the packages to stick to its own namespace and to use \newcommand instead of \def in order to avoid such things.

Namespace "XY" could, e.g., be implemented like this:

  \expandafter\XYexchange\expandafter{\csname XY#2\endcsname}{0 #1}%
% defining macros within the namespace:
% calling macros from within the namespace:
\csname\XY mymacro\endcsname{Arg1}{Arg2}
\csname\XY myothermacro\endcsname{Arg1}{Arg2}
\csname XYmymacro\endcsname{Arg1}{Arg2}
\csname XYmyothermacro\endcsname{Arg1}{Arg2}




Download (114B)



datetime v2.59 now defines \ifDTleapyear. To ensure backward-compatibility, if \ifleapyear hasn't been defined, it's defined to be \ifDTleapyear. The \@modulo command is defined in fmtcount rather than datetime. This will be fixed in future versions of fmtcount. To cover the overlap between releases of the datetime and fmtcount, datetime uses \@FCmodulo instead of \@modulo, but there's a check to see if \@FCmodulo has been defined after loading fmtcount. If it hasn't then \@FCmodulo is set to \@modulo.

There's nothing I can do about datenumber's use of \def. You'll have to raise the issue with datenumber's maintainer. LaTeX3 should hopefully solve the problem of namespaces.



Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.


You can use the following markup:


[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]

Ordered list:
[li]first item[/li]
[li]second item[/li]

Unordered list:
[li]first item[/li]
[li]second item[/li]

You can use the Preview button to review your message formatting before submitting.

Page permalink: