I want to compress numbers of sections in a reference, but without repeating the chapter number, while maintaining full functionality of of hyperref and \ref.
\documentclass{book}
\usepackage{hyperref}
\usepackage{bookmark}
\begin{document}
\chapter{intro}
I want the hyperref functionallity and automated references of
\ref{sec:chap3sec3}--\ref{sec:chap3sec5};
but the look of 3.3--5.
\ref{sec:chap3sec3}--\hyperref[sec:chap3sec5]{5} does half of what I want,
but I don't know how to get the section number without chapter number.
\chapter{two}
\chapter{three}
\section{chap3sec1}
\section{chap3sec2}
\section{chap3sec3}\label{sec:chap3sec3}
\section{chap3sec4}
\section{chap3sec5}\label{sec:chap3sec5}
\end{document}
How can I do this?
cleverefbe an option? – Gonzalo Medina May 8 '12 at 14:22\crefrange{eq1}{eq5}is typeset asEqs.~(1.1) to~(1.5)according to the manual;\crefrangelabelformatallows to change theto~, but not the individual labels. Unless I missed something in the manualcleverefis no help. – Markus Schmassmann May 8 '12 at 14:36\crefrangecommand. All sections in your document are numbered with the respective chapter number prefixed to the the section numbers, right? If that's the case, I think you're risking creating a lot of confusion among your readers if you omit the chapter number prefix from some of the section numbers used in a cross-reference. "Sections 3.3--3.5" is unambiguous, though not all that elegant. Do you want your readers to puzzle, however briefly, over whether "Sections 3.3--5" means "Section 3.3 to Chapter 5"? – Mico May 8 '12 at 15:16cleverefpackage. – Mico May 8 '12 at 16:35