# Svn-multi vs hyperref vs non-ascii svn info vs memoir headers

Here is the strange error of the day. Last weekend for "fun" I was playing around with Win 8 and TortoiseSVN. All of a sudden after a commit my LaTeX project no longer compiled.

I'm down to the following MWE combo

Master file:

\documentclass[a4paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\makepagestyle{test}
\makeoddfoot{test}{}{\sffamily\thepage}{}
\pagestyle{test}
\usepackage[filehooks]{svn-multi}
\begin{document}

Test
\input{test2}

\end{document}


test2.tex

\svnidlong
{$HeadURL: https://url$}
{$LastChangedDate: 2015-07-26 15:59:20 +0200 (sø, 26 Jul 2015)$}
{$LastChangedRevision: 1$}
{$LastChangedBy: daleif$}

\chapter{test}

test


Note how the LastChangedDate contains sø in UTF8. I usually work on Linux with an English setup, so elsewhere that part will be Sun (ascii)

So here are my observations

I get the error

./test2.tex:8: Undefined control sequence.
GenericError  ...
#4  errhelp @err@       ...
l.8 \chapter
{test}

1. If I remove the ø the MWE compiles
2. I remove \sffamily from the footer it compiles
3. If I remove hyperref it compiles
4. If I remove the filehooks option from svn-multi, it compiles

Any idea what is going on?

(a viable solution would also be to explain how to tell TortoiseSVN to always use English, sø is short for the Danish word søndag for Sunday)

• Also works if you remove \chapter ;). – cfr Aug 28 '15 at 11:49

This is a classic '\edef (or similar) applied to fragile user input' issue: there's an \xdef in \svn@pushfilestack which fails if you have an 'unsafe' token inside any of the parts it's trying to apply that to. As with any LaTeX2e user input, the correct approach is to use the LaTeX kernel \protected@... equivalent

\documentclass[a4paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\makepagestyle{test}
\makeoddfoot{test}{}{\sffamily\thepage}{}
\pagestyle{test}
\usepackage[filehooks]{svn-multi}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\svn@pushfilestack{\xdef}{\protected@xdef}{}{}
\makeatother

Ideally this should get fixed in svn-multi.