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.

Update

This bug has been fixed with version 0.18.9 of cleveref, which is currently on ctan.

Question

Babel and cleveref do not seem to work flawlessy together when they share the same language option. In the MWE, the output of Some text\leftmark in the main text should be equal to Some text1 Chapter, but there is an extra space in front of 1 Chapter. In the header, this has the effect that its text is not inline with the body text. Interestingly, this problem disappears when babel uses another language option, eg. english.

MWE

\documentclass{scrbook}

\usepackage[spanish]{babel}
\usepackage[spanish]{cleveref}

\begin{document}
\chapter{Chapter}
\clearpage
\noindent Some text\leftmark
\end{document}
share|improve this question

1 Answer 1

up vote 11 down vote accepted

It's a bug in cleveref. If I change line 4516 of cleveref.sty from

4516   \PackageInfo{cleveref}{loaded `spanish' language definitions}

into

4516   \PackageInfo{cleveref}{loaded `spanish' language definitions}%

the space disappears.

This is common with all the other languages and should require a bug fix.


As a temporary workaround you can say

\documentclass{scrbook}

\usepackage[spanish]{babel}
\usepackage[spanish]{cleveref}

\usepackage{etoolbox}
\AtBeginDocument{
  \patchcmd{\extrasspanish}
    {\PackageInfo {cleveref}{loaded `spanish' language definitions} }
    {\PackageInfo {cleveref}{loaded `spanish' language definitions}}
    {}{}
}

\begin{document}

\chapter{Chapter}
\clearpage

\noindent Some text\leftmark

\end{document}

Really minimal example

\documentclass{article}

\usepackage[spanish]{babel}
\usepackage[spanish]{cleveref}

\begin{document}
X\foreignlanguage{spanish}{X}X
\end{document}

The output, without the correction, is

X XX

With the correction it is

XXX

share|improve this answer
    
Thanks for the quick help egreg. I am going to report the author this bug, if you haven't already done so. –  maetra Jan 29 '13 at 17:13
    
@maetra Please, do. –  egreg Jan 29 '13 at 17:15
    
According to the author, this bug should be fixed in the next release of cleveref. –  maetra Jan 31 '13 at 12:48

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.