Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a very strange behavior which I have managed to get boil downed into this minimal example. It's probably a bug report for either memoir or babel developers (where should that be sent?) but I thought I should ask here if anyone can help me to get this working. The problem can be seen in page five of the generated document:

?? in header

I was expecting "Regarding chapter 1" but got "Regarding chapter ??". If I removed the babel package it seems to work... But I need it. Is there other solutions?

\documentclass{memoir} 
\usepackage[greek, english]{babel}
\usepackage{lipsum}

\begin{document} 
\pagestyle{headings} 
\chapter{Lorem} 
\label{one}
\lipsum[1-5]

\chapter{Comments} 
\lipsum[1-3] 
\section{Regarding chapter~\ref{one}}
\lipsum[1-5]

\end{document}
share|improve this question
    
I realize that the heading of the question probably is quite long. Feel free to make it better if you see an easy way! (I don't...) –  jonalv Aug 8 '11 at 15:38
    
Did you compile your document twice? –  Gonzalo Medina Aug 8 '11 at 15:43
    
This isn't specific to memoir; it happens also with the book class, so it's mainly a babel issue. –  Alan Munn Aug 8 '11 at 15:44
    
That's interesting. So babel is the problem then. I thought the headings pagestyle was a memoir thing so I didn't bother trying the book class. Is there a workaround though? –  jonalv Aug 8 '11 at 15:53

2 Answers 2

up vote 5 down vote accepted

If you look at the console log, you will find that the error reported is that the label ONE is undefined. Yet your label is one. This shows that the problem is that the label is being converted with \MakeUppercase or its equivalent before the reference is being resolved. A partial solution is to wrap the reference in \lowercase, or make the label all uppercase. I've gone for the latter in the following example.

\documentclass{memoir} 

\usepackage[greek, english]{babel}
\usepackage{lipsum}

\begin{document} 
\pagestyle{headings} 
\chapter{Lorem} 
\label{ONE} % make label uppercase
\lipsum[1-5]

\chapter{Comments} 
\lipsum[1-3] 
\section{Regarding chapter~\ref{ONE}}
\lipsum[1-5]

\end{document}
share|improve this answer

It's caused by the way of using uppercase heading, it affects the reference. An easy workaround would using capital letter labels for cross-references where you know they will be used in capitalized text. You will see it if you write \label{ONE} and later

\section{Regarding chapter~\ref{ONE}}

Surely it can be repaired. Though I recommend not using all caps text but for example \scshape instead.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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