4

Anyone able to explain why this is? Here's a mwe. If I comment out the two datetime2 lines, document compiles fine, otherwise failure occurs on \opening:

\documentclass[a4paper,
    margin=2cm,
    headlines=4,
    parskip=full]{scrartcl}

\usepackage[%
    foldmarks=false,
    fromalign=right,
    fromrule=off,
    refline=dateleft,
    fromphone=false,
    fromemail=true,
    pagenumber=footright,
    fromlogo=false]{scrletter}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
%\usepackage{showframe}

\usepackage[en-GB]{datetime2}
\DTMlangsetup[en-GB]{ord=raise}

\begin{document}
\begin{letter}{%
        A. N. Other\\
        Someplace\\
        ZIP CODE%
    }
\opening{test}
\closing{cheers}
\end{letter}
\end{document}

EDIT:

log output

! TeX capacity exceeded, sorry [input stack size=5000].
\sym@date ->\if@orgdate \sym@date 
                                  \else \num@date \fi 
l.31         \opening{test}
                           
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
3
  • Please add the complete error message to your question ... BTW: Welcome to TeX.SE!
    – Mensch
    Commented Feb 27, 2022 at 19:14
  • @Mensch OK, done.
    – Timmy
    Commented Feb 27, 2022 at 19:17
  • 1
    I think the two packages are not compatible. scrletter redefines \today at begin document. So even if you avoid the error you actually don't get the datetime2 commands. Commented Feb 27, 2022 at 20:11

1 Answer 1

1

There seems to be two ways to avoid this error:

  1. Add a global option british. (I noticed this because in the documentation of datetime2 there are plenty of \documentclass[british]{article}.)
  2. Load babel after datetime2 (but this might not be a very good idea)
\documentclass[a4paper,
    margin=2cm,
    headlines=4,
    parskip=full,
    british,
    ]{scrartcl}

\usepackage[%
    foldmarks=false,
    fromalign=right,
    fromrule=off,
    refline=dateleft,
    fromphone=false,
    fromemail=true,
    pagenumber=footright,
    fromlogo=false]{scrletter}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

% \usepackage[en-GB]{datetime2}
% \DTMlangsetup[en-GB]{ord=raise}

\usepackage[english]{babel}
%\usepackage{showframe}

\usepackage[en-GB]{datetime2}
\DTMlangsetup[en-GB]{ord=raise}


\begin{document}
\begin{letter}{%
        A. N. Other\\
        Someplace\\
        ZIP CODE%
    }
\opening{test}
\closing{cheers}
\end{letter}
\end{document}
1
  • 1
    First way doesn't work. Only putting babel after datetime2 irrespective of whether global option 'british' is added, works. Why is loading babel after datetime2 not advisable?
    – Timmy
    Commented Feb 27, 2022 at 20:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .