Generalcleveref | Cross-references in Appendix fail

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Bob_the_Topper
Posts: 15
Joined: Thu May 03, 2012 4:54 pm

cleveref | Cross-references in Appendix fail

Post by Bob_the_Topper »

Hi!

I use cleveref to get more convenient cross references which among other things support multiple references inside a single command. This works fine except in the appendix. Whenever I put multiple references inside a single \cref{} in the appendix I get an error on the second run of PDFLaTeX.

Here's a minimal example ...

Code: Select all

\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{cleveref}

\begin{document}

\appendix

\section{Section One}
\label{A}
Merged cref: \cref{A,B}

\section{Section Two}
\label{B}
Merged cref: \cref{A,B}

\end{document}
... and the error PDFLaTeX produces:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   {
l.13 Merged cref: \cref{A,B}
Without the \appendix everything works just fine. Any ideas how to fix this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: cleveref | Cross-references in Appendix fail

Post by Stefan Kottwitz »

This code example works for me without errors. I'm using scrbook 2011/04/02 v3.09 and cleveref 2011/03/22 v0.17.9. Check your files and perhaps update.

Stefan
LaTeX.org admin
Bob_the_Topper
Posts: 15
Joined: Thu May 03, 2012 4:54 pm

cleveref | Cross-references in Appendix fail

Post by Bob_the_Topper »

Stefan_K wrote:This code example works for me without errors. I'm using scrbook 2011/04/02 v3.09 and cleveref 2011/03/22 v0.17.9. Check your files and perhaps update.
Thanks for your reply. I updated my TexLive and the small test example compiles fine now.

Unfortunately that didn't fix my original problem. In my main file I use cleveref in combination with varioref and that still results in the error.

Here is an updated example:

Code: Select all

\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{varioref}
\usepackage{cleveref}

\begin{document}

\appendix
\pagenumbering{roman}

\section{Section One}
\label{A}
Merged vref: \vref{A,B}

\clearpage
\section{Section Two}
\label{B}
Merged vref: \cref{A,B}

\end{document}
Error during the second run of pdflatex:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   i
l.16 Merged cref: \vref{A,B}
When I comment out either \appendix or \pagenumbering{roman} it works, but not with both present.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

cleveref | Cross-references in Appendix fail

Post by Stefan Kottwitz »

Also the updated example works for me. What did you update? Which package versions do you use now? The difference in your updated example, compared to the first example, is that you use varioref. If you did just update cleveref and perhaps KOMA-Script, you may need to update varioref too. For me, it works with TeX Live 2011.

Perhaps add \listfiles to your preamble, compile again, and post the new .log file of that example as attachment.

Stefan
LaTeX.org admin
Bob_the_Topper
Posts: 15
Joined: Thu May 03, 2012 4:54 pm

cleveref | Cross-references in Appendix fail

Post by Bob_the_Topper »

Stefan_K wrote:What did you update?
Since the native packages for my Linux only provide TeXLive 2009 I installed a "vanilla" TexLive 2011 and use that. So all packages should be up to date.
Stefan_K wrote:Which package versions do you use now?
[...]
Perhaps add \listfiles to your preamble, compile again, and post the new .log file of that example as attachment.
Thanks. I didn't remember that command O:-)

These are the versions I use:

Code: Select all

*File List*
 scrbook.cls    2012/03/08 v3.10a KOMA-Script document class (book)
scrkbase.sty    2012/03/08 v3.10a KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
 scrbase.sty    2012/03/08 v3.10a KOMA-Script package (KOMA-Script-independent basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2011/03/09 v3.09 KOMA-Script package (loading files)
tocbasic.sty    2011/05/30 v3.09a KOMA-Script package (handling toc-files)
scrsize11pt.clo 2012/03/08 v3.10a KOMA-Script font size class option (11pt)
typearea.sty    2012/03/08 v3.10a KOMA-Script package (type area)
inputenc.sty    2008/03/30 v1.1d Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
varioref.sty    2011/10/02 v1.4z package for extended references (FMi)
cleveref.sty    2012/03/07 v0.18.5 Intelligent cross-referencing
***********
Attached is the complete .log of the second run of PDFLaTeX.
Attachments
test.log
logfile for the second run of pdflatex (producing the error)
(15.38 KiB) Downloaded 439 times
Bob_the_Topper
Posts: 15
Joined: Thu May 03, 2012 4:54 pm

cleveref | Cross-references in Appendix fail

Post by Bob_the_Topper »

Any more ideas what's going wrong here? Maybe an regression bug in cleveref?
Post Reply