2

This question is very similar to this one. I use hyperref, and I want to refer to a chapter by its full name. The solution provided in the linked post uses \nameref{}, which gets the short title, it seems. Is there a way to get the long (full) title instead?

Example:

\documentclass{book}
\usepackage[utf8]{inputenc}

\usepackage[hidelinks]{hyperref}

\begin{document}

\chapter[Short title]{Longer title}\label{ch}

In Chapter~\ref{ch}: ``\nameref{ch}'', you'll see this text.

\end{document}

Output:

Tex output

  • As far as I understand, the part in square brackets is not a short variant of the chapter (section, subsection ...) title, but rather its unstyled form that is for example used in PDF hyperlinks etc. and also for referencing. Anyways, isn't this somehow similar: https://tex.stackexchange.com/q/13749/47927 ? – Jasper Habicht Mar 23 '21 at 10:57
  • @JasperHabicht I have been told that it is the short version, or at least it is used that way for instance in the page headings where only the short title is displayed to save space. – Bram Vanroy Mar 23 '21 at 11:10
  • You are right, it is used in different places and therefore often also used for a shortened version. Well, maybe you can indeed use it like this, if I think about it. I found some more similar questions, though: https://tex.stackexchange.com/a/388510/47927 and https://tex.stackexchange.com/a/389082/47927 – Jasper Habicht Mar 23 '21 at 11:24

0 Answers0