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?

3
  • 1
    Using \phantomsection?
    – user121799
    Feb 23, 2019 at 5: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, 2019 at 5:52
  • 8
    How do you number subsections of an unnumbered section?
    – egreg
    Feb 23, 2019 at 10:04

1 Answer 1

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

1
  • 8
    But what if the starred section occurs after one or more numbered sections, with more numbered sections following? Jul 24, 2019 at 1:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .