# “!Missing $inserted.” when using svn$Id$keyword substitution I'd like to to surface subversion revision numbers for use in the contents of my document. svninfo and svn packages rely on svn keyword substitution to accomplish this, but I get this error when I try it: Error line 6 ! Missing$ inserted.

Here's the entire document that causes this:

\documentclass{article}
\usepackage{svninfo}

\begin{document}
\svnInfo $Id: doc.tex 8 2013-04-11 19:37:31Z User Name$ %<= Id keyword substituted by svn

\end{document}

The usual suggested remedies for this error are to escape the $like this: \$ However, no combination of escaped and non-escaped $characters both avoids this error and has useful results. How do I avoid this error and surface svn revision numbers? - add comment ## 2 Answers The username may not have a space. this runs without error \documentclass{article} \usepackage{svninfo} \begin{document} \svnInfo$Id: doc.tex 8 2013-04-11 19:37:31Z UserName $%<= Id keyword substituted by svn \end{document} Since Windows user name allows spaces, you can let svnInfo allow them as well. this seems to work: \documentclass{article} \usepackage{svninfo} \makeatletter \def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6$ {\@svnEndRead
\@svnInfoCrackString #2 #3 #4 #5 {#6} $% } \makeatother \begin{document} \svnInfo$Id: doc.tex 8 2013-04-11 19:37:31Z User Name $%<= Id keyword substituted by svn [\svnInfoOwner] \end{document} - @alx9r it may be worth asking the package maintainer to update the package with this patch to support spaces – David Carlisle Apr 11 '13 at 20:55 Thanks very much. That indeed works. I have sent an email linking here to the package maintainer. – alx9r Apr 11 '13 at 21:41 add comment You have a space in the user name: \svnInfo$Id: doc.tex 8 2013-04-11 19:37:31Z UserName \$

should work

-
+1 (9 sec before my deleted answer:-) –  David Carlisle Apr 11 '13 at 20:27
That's it. In case it helps someone else, the user name, complete with space, was lifted by ToroiseSVN from the underlying Windows 7 account. –  alx9r Apr 11 '13 at 20:31
@alx9r ooh it would be easy enough to modify \svnInfo to allow a space sounds like that would be useful as svn is going to keep putting the space back? –  David Carlisle Apr 11 '13 at 20:39
@DavidCarlisle Yes that would be very useful. All of the other workarounds I've found so far are pretty messy. –  alx9r Apr 11 '13 at 20:44
@alx9r: User~Name should work –  Herbert Apr 12 '13 at 5:56