0

Here is a MWE:

\documentclass[11pt]{book}

\renewcommand\thesubsection{\hspace{10mm}\arabic{subsection}.}

\usepackage{titlesec} 
    \titleformat{\subsection}[runin]{\normalfont\large\bfseries}{\thesubsection}{1mm}{}{}
\usepackage[hyperfootnotes=false]{hyperref}%
\usepackage{cleveref}%

\begin{document}
\chapter{One}\label{1-0-0}
\section{one}\label{1-1-0}
\subsection{Title}\label{1-1-1}
for this text. text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 


References:

\Cref{1-0-0} \nameref{1-0-0}

\Cref{1-1-0} \nameref{1-1-0}

\Cref{1-1-1} \nameref{1-1-1}
\end{document}

Result

There are two issues:

  1. The reference to subsection 1. Title is called Section instead of Subsection.
  2. The number in the reference is the number that I want to show in the text, 1., but in the reference I want the full number, 1.1.1.

1 Answer 1

1

Do not redefine \thesubsection if the appearance should only be changed in the subsection header. Use \titleformat instead:

\titleformat{\subsection}[runin]{\normalfont\large\bfseries}{\hspace{10mm}\arabic{subsection}.}{1mm}{}{}

To change the name reference name of the subsections printed by \Cref use:

\Crefname{subsection}{Subsection}{Subsections}

enter image description here

Code:

\documentclass[11pt]{book}
\usepackage{titlesec} 
\titleformat{\subsection}[runin]{\normalfont\large\bfseries}{\hspace{10mm}\arabic{subsection}.}{1mm}{}{}
\usepackage[hyperfootnotes=false]{hyperref}%
\usepackage{cleveref}%
\Crefname{subsection}{Subsection}{Subsections}

\begin{document}
\chapter{One}\label{1-0-0}
\section{one}\label{1-1-0}
\subsection{Title}\label{1-1-1}
for this text. text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 

References:

\Cref{1-0-0} \nameref{1-0-0}

\Cref{1-1-0} \nameref{1-1-0}

\Cref{1-1-1} \nameref{1-1-1}
\end{document}
2
  • After all these years, still having to bother others for something I ought to be able to figure out by myself. Sigh. Thanks.
    – schremmer
    Commented Aug 1, 2017 at 13:52
  • Unfortunately, my MWE was too small as it did not include tables of contents created with titletoc. Modifying this question seemed too awkward at this point and so I have asked a new question: tex.stackexchange.com/questions/384295/…
    – schremmer
    Commented Aug 1, 2017 at 16:00

You must log in to answer this question.

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