Somehow there is a strange conflict with the svn package and the titling package. The following code gives me an error on TeXLive 2010 (but on an old TeX distribution at my work computer, it compiles just fine).


\SVN $Date: 2011-05-06 20:57:26 +0100 (Fri, 06 May 2011) $



When I try to build it, I get hit with a problem with input stack size

This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, pi
nyin, bulgarian, russian, ukrainian, ukenglish, usenglishmax, basque, french, l
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
! TeX capacity exceeded, sorry [input stack size=5000].
\GenericError ->\protect 
l.6 \date{\SVNDate}

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.

The problem goes away if either

  • I don't use the titling package
  • If I don't actually use a real SVN Date. That is, if the SVN line is replaced by just \SVN $Date$

Any ideas? Any more information I should include? (I'm also not sure what tags to use for this question.)

Edit If I increase the stack_size in texmf.cnf, the error becomes

! TeX capacity exceeded, sorry [parameter stack size=14000].
\PackageError #1#2#3->
                      \GenericError {(#1)\@spaces \@spaces \@spaces \@spaces...
l.6 \date{\SVNDate}

As the svn manual states in section 2.5 Known Issues the flexibility of \SVNDate to change its format e.g. when the language is changed does not allow its usage inside an expanded context (e.g. \edef). It is therefore defined to create an error message if it is used inside \edef. I'm personally not sure if this is a wise design decision. Defining \SVNDate as a robust macro would be a better idea. Now the titling package uses \protected@xdef which seems to cause an endless loop while expanding the error message.

This error can be avoided by ensuring that \SVNDate isn't expanded by \date. This can be done by the usual \protect, the plain \noexpand or, if this is required more often, by redefining \SVNDate to be robust:

% or
% or
% or

The problem is that titling redefines \date so it can be used again. The redefinition is in the following code:


As a workaround, you could comment out this code although you would lose the reuse of date.)

Perhaps someone with more knowledge than me can propose an actual solution.


After a bit more experimenting, apparently a sufficient work around is to protect the argument to the new \date command


So far it works, but I don't know if it has any side-effects or if it is bad practice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.