4
\documentclass[a4paper,12pt]{report}
  %------------------------------------------------------------
  \usepackage{amssymb,amsmath,amsthm,latexsym,mathrsfs,amsfonts,dsfont}
  %-----accent                      
 \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage[colorlinks=true,pagebackref=true]{hyperref}
 \hypersetup{urlcolor=blue, citecolor=red, linkcolor=blue}
  \newtheorem{corollary}{Corollary}[section]

\usepackage[capitalise,noabbrev,nameinlink]{cleveref}
\begin{document}
\chapter{Preliminary}
 ....The crucial idea of the proof is to make use ..... (see \cref{fekete} in \cref{app}). 

\chapter*{Appendix}\label{app}
\begin{corollary}\label{fekete}

\end{corollary}
\end{document}

I want to obtain

enter image description here

  • 2
    You never heard of \appendix? – Johannes_B Feb 17 at 6:46
  • 1
    I don't understand your question. – Schüler Feb 17 at 6:47
  • 2
    Add \appendix before \chapter*{Apendix} and compile ... – Kurt Feb 17 at 6:50
  • 1
    @Schüler -- The problem "persists" because your document setup has a fundamental flaw. If there's a single unnumbered appendix chapter, it's overkill to adduce the cleveref machinery to create a cross-referencing call-out. You could (actually, should) write "... according to corollary X in the appendix". In my view, though, it does make sense to number the appendix chapters, even if there's just one chapter of this type. What you would have to do -- in addition to inserting that loathsome \appendix instruction -- is change \chapter*{Appendix} to \chapter{Supplemental Material}. – Mico Feb 17 at 8:00
  • 1
    Thank you. So I think I write simply "... according to corollary X in the appendix". – Schüler Feb 17 at 8:05
6

You need to add \appendix before your line \chapter*{Appendix} and delete the * to get a numbered appendix. Then cleveref can work.

Please see the code (I changed your label to better ones!)

\documentclass[a4paper,12pt]{report}

%\usepackage{amssymb,amsmath,amsthm,latexsym,mathrsfs,amsfonts,dsfont}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xcolor}
\usepackage[colorlinks=true,pagebackref=true]{hyperref}

\usepackage[capitalise,noabbrev,nameinlink]{cleveref}

\hypersetup{urlcolor=blue, citecolor=red, linkcolor=blue}
\newtheorem{corollary}{Corollary}[section]


\begin{document}

\tableofcontents

\chapter{Preliminary}
The crucial idea of the proof is to make use ..... (see \cref{cor:fekete} in \cref{cha:app}). 

\appendix
\chapter{Supplemental material}\label{cha:app} % <=======================================
\begin{corollary}\label{cor:fekete}

\end{corollary}

\end{document}

and its result:

enter image description here

and page 3:

page 3

with better chapter heading and no double Apendix :-)

  • Thank you but after compilation, I find Appendix A Appendix Corollary A.0.1. I hope to find only Appendix without A. – Schüler Feb 17 at 7:05
  • Please after compilation, see page 3. Thanks a lot. – Schüler Feb 17 at 7:39
  • 1
    @Schüler \appendix is born for that purpose, i.e. this is the standard solution. – JouleV Feb 17 at 8:01
  • 1
    @Schüler with adding \appendix you tell LaTeX appendix is starting now. That is the reason cleverref can add appendix A in your link. To get rid of the second Appendix comming from your \chapter*{appendix} change the heading for the chapter to a better suited name, for example "Supplemental Material", als already mentioned by Mico. With cleverref you can not reference to a starred chapter. That is only possible with \hyperlink{appendixlabel}{appendix} and \hypertarget{appendixlabel}{text in appendix}. I do not recommend that! – Kurt Feb 17 at 8:22
  • 1
    @Schüler No, it is not if you want to use the functionality of cleveref. You can use the starred chapter, but then you have to use \hyperlink and \hypertarget, which results in other problems, for example the hypertarget is shown as first line and not the heading appendix as usual in the rest of the document ... Believe me it is good typography to use \appendix and getting letter A in the link ... – Kurt Feb 17 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.