# Cross reference in section title broken in header [duplicate]

I've tried searching and can't find this anywhere, but sorry if it's been asked before.

I'm using the memoir class to write a thesis using LaTeX (which I'm fairly new to) and I've got a section in my appendix with some solutions to an equation, so I've titled the section using

\section{Solutions to equation in section~\ref{sec:xxxxx}}


This displays as it should at the start of the section, so the cross-reference isn't broken, but in the header at the top of odd pages the reference doesn't work; it prints as

A.2. SOLUTIONS TO EQUATION IN SECTION ??

I can't find any way to fix this, short of manually changing it using %\sectionmark{} or removing the cross-reference.

Can anyone give me some suggestions?

Edit: It turns out the hyperref package is causing the problems (if I disable that package it works). I need hyperlinks to external websites in the document so I can't disable the hyperref package. I'm looking for solutions online but I'd appreciate any help in the meantime.

EDIT BY LOCKSTEP: Here's a MWE showing the problem. Note that the problem is not related to the memoir class -- it also shows up with article (if one uses \pagestyle{headings}).

\documentclass{memoir}

\usepackage{hyperref}

\begin{document}

\section{foo}\label{sec:foo}

\cleardoublepage

\section{Solutions to equation in section~\ref{sec:foo}}

\end{document}​

-

## marked as duplicate by Speravir, zeroth, Kurt, mafp, WernerFeb 25 '13 at 2:08

The following example works for me (compile two times!): \documentclass{memoir}\begin{document}\section{foo}\label{sec:foo}\cleardoublep‌​age\section{Solutions to equation in section~\ref{sec:foo}}\end{document}​ –  lockstep Feb 24 '13 at 13:03
It seems to be linked to the fact that the default headers in the memoir class use all uppercase characters - changing the label to uppercase fixes it. Another option is to use \nouppercaseheads to change the headers so they are no longer uppercase.
This is really crazy! Thank you. I had the same problem. It seems to happen whenever ref is used in section titles that are uppercase. To clarify for anyone else. Change your label from \label{sec:foo} to \label{SEC:FOO}. This solves the problem despite how odd it is. –  passerby51 Jan 30 at 23:10