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 '19 at 6:46
  • 1
    I don't understand your question. – Schüler Feb 17 '19 at 6:47
  • 2
    Add \appendix before \chapter*{Apendix} and compile ... – Mensch Feb 17 '19 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 '19 at 8:00
  • 1
    Thank you. So I think I write simply "... according to corollary X in the appendix". – Schüler Feb 17 '19 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 :-)

| improve this answer | |
  • 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 '19 at 7:05
  • Please after compilation, see page 3. Thanks a lot. – Schüler Feb 17 '19 at 7:39
  • @Schüler - If you want to have a numbered appendix, you must switch from \chapter*{...} to \chapter{...}. If you do not want to number the appendix, there's simply no point in using the \cref machinery to create a cross-referencing call-out; instead, just write "in the appendix". – Mico Feb 17 '19 at 7:47
  • Thank you but, is there another idea instead \appendix? – Schüler Feb 17 '19 at 7:52
  • 1
    @Schüler \appendix is born for that purpose, i.e. this is the standard solution. – user156344 Feb 17 '19 at 8:01

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.