I have some problems with cleveref
and titlesec
, providing a minimal working example below:
\documentclass{report}
\usepackage{titlesec} %% <-- the issue as far as i know, but i need the package
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\chapter{ninjas are okay}
some text \cref{app:ninja_bkg} bla bla and \cref{app:ninja_fail}
\appendix
\chapter{ninja background}
\label{app:ninja_bkg}
ninjas originated from ???
\section{ninja fail}
\label{app:ninja_fail}
usually ninjas dont fail, but sometimes they do
\end{document}
where the line in the middle produces:
some text appendix A bla bla and section A.1
But I want:
some text appendix A bla bla and appendix A.1
If I remove the titlesec
package everything works fine, but sadly I need it. Guessing titlesec
redefines \section
, but I'm not enough of a latex-hacker to fix it =/
Best Answer
You can use (as described in
cleveref
's documentation)\crefname
,\Crefname
, and the optional argument for the\label
command to supply a new "type" for the sections in the appendices, ; a little example:The
cleveref
documentation gives a hint about using thealiascnt
package to avoid having to use the optional argument for the new type (I haven't tested this approach, though).