0

In How to \label-\ref an un-numbered section, Nathan Grigg pointed out that one could use the \hyperref commmand to create a link to a starred section as follows

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section*{Preface to the article}
\label{s:intro}
\hyperref[s:intro]{Introduction}
\end{document}

My question now is how to create a link to a numbered subsection of that starred section?

Mico
  • 506,678
schremmer
  • 2,107
  • 1
    Using \phantomsection? –  Feb 23 '19 at 05:34
  • Why not cross-reference such a subsection the usual way, i.e., via \label and \ref (or \autoref)? The "number" that gets used in such a cross-reference will look slightly odd, but that's because subsection numbers look odd too. – Mico Feb 23 '19 at 05:52
  • 8
    How do you number subsections of an unnumbered section? – egreg Feb 23 '19 at 10:04

1 Answers1

0

Somehow, it was egreg's comment that gave me the hint. This is using cleveref AFTER hyperref:

\documentclass{book}
\usepackage{hyperref}
\usepackage{cleveref}
    \crefname{subsection}{Subsection}{Subsections}
\begin{document}
\chapter{ONE}\label{1-0-0}
\section*{Starred Section}\label{STR:1-0-0}
\subsection{First subsection of the starred section}\label{STR:1-0-1}
\section{First \emph{Non}-Starred Section}\label{1-1-0}
\subsection{First subsection of the first \emph{non}-starred section}\label{1-1-1}

\cref{STR:1-0-1} \nameref{STR:1-0-1} of the \hyperref[STR:1-0-0]{Starred Section} of \cref{1-0-0} \nameref{1-0-0}  on \cpageref{1-0-0}

\cref{1-1-1} \nameref{1-1-1} of  \cref{1-1-0} \nameref{1-1-0}   \labelcref{1-1-0} of \cref{1-0-0} \nameref{1-0-0}  on \cpageref{1-0-0}

\end{document}

SubStarredSection

schremmer
  • 2,107