I am writing a book with multiple chapters (in different sections, if that is relevant). Chapters are numbered. I want a way to transform the chapter name into the chapter number, someplace else in my text. That is, I want to say "See Chapter 4, which covers magic in depth". The chapter that is responsible for covering magic in depth may change over the course of the editing process: I want the chapter number to change with it automatically. I don't want to refer to the name alone. I am using LaTeX's autonumbering for chapters. Is this possible?
\documentclass[12pt,a4paper]{book}
\usepackage[latin1]{inputenc}
\begin{document}
\chapter{Sample 1}
This is covered in more detail in Chapter X.
\chapter{Sample 2}
\end{document}
nameref
and\nameref{chapterlabel}
should work, wherechapterlabel
is something you stated right after\chapter{Magic}
, say e.g.\label{magicchapter}
. But your request is a little confusing since there seem to be wanted two different behaviours of the reference?\documentclass{...}
and ending with\end{document}
.\nameref*{CurrentSection::Title::<something>}
and printing the section counter along with it, is what he's looking for. Similar to how you determined the CurrentSection counter at the Index for the request I made here tex.stackexchange.com/questions/175054/…