Generalcleveref | Multiple References in Appendix

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
craq
Posts: 6
Joined: Tue Jul 28, 2009 1:01 pm

cleveref | Multiple References in Appendix

Post by craq »

Hi,
I use the cleveref package to reference more than one equation simultaneously, like multicite. But it doesn't work in the appendix. I get the error
"A number should have been here; I inserted `0'." in the log file or
"Missing number, treated as zero. I use \cref{eqn:3,eqn:4}" in the kile output. This minimum working example should show what I mean:

Code: Select all

\documentclass[a4paper,10pt]{report}
\usepackage{cleveref}
\begin{document}
\chapter{sec1}
\begin{equation}
 1+1=2\label{eqn:1}
\end{equation}
\begin{equation}
 1+1=2\label{eqn:2}
\end{equation}
I use \cref{eqn:1,eqn:2}

\appendix
\chapter{app1}
\begin{equation}
 1+1=2\label{eqn:3}
\end{equation}
\begin{equation}
 1+1=2\label{eqn:4}
\end{equation}
I use \cref{eqn:3,eqn:4}
\end{document}
Does anybody know how to make it work? Is it a bug in cleveref?
Last edited by craq on Mon Nov 07, 2011 12:00 pm, edited 1 time in total.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

cleveref | Multiple References in Appendix

Post by localghost »

No problem here. Perhaps a matter of an outdated package. Add the \listfiles command as very first line to your example and take a look at the list of used files in the log file. Compare with mine.

Code: Select all

 *File List*
  report.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
cleveref.sty    2011/03/22 v0.17.9 Intelligent cross-referencing
 ***********
Get an update as the case may be.

P.S.: Very good example.


Thorsten
craq
Posts: 6
Joined: Tue Jul 28, 2009 1:01 pm

cleveref | Multiple References in Appendix

Post by craq »

You were right, thanks! I had cleveref.sty from 2009, which is in the current version of texlive in the ubuntu repositories. It was a bit of a challenge to install the new texlive manually, so I'll write out what I did here. (At least I'll be able to find it next time.) The main problem was disk space, texlive 2011 is 3GB!
  1. Check free disk space on the root (or /usr) partition
  2. Download latest texlive and run install.tl
  3. edit /etc/texmf/texmf.d/05TeXMF.cnf so that the path where texlive is installed appears on the "main distribution tree". Specifically, change
    TEXMFDIST = /usr/share/texmf-texlive
    to
    TEXMFDIST = /usr/local/texlive/2011/;/usr/share/texmf-texlive
  4. sudo update-texmf && sudo texhash && sudo mktexlsr
Post Reply