0

Inspiring from this answer, we have

\documentclass[12pt,a4paper]{article}
%------------------------------------------------------------
\usepackage{amsmath,amssymb,amsthm}
%------------------------------------------------------------
\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}

 \begin{corollary}\label{cor}(\cite[Corollary 3]{4})
    A unilateral weighted shift $T$ on ....
 \end{corollary}

By \cref{cor}, there exists a polynomial......

\begin{thebibliography}{10}

  \bibitem{4}{W. Arendt, J.R. Goldstein, and J.A. Goldstein:} {Outgrowths
  of Hardy's inequality,} Contemp. Math. 412 (2006), pp. 51-68.

   \end{thebibliography}

   \end{document}
    \end{document} 

enter image description here

I hope that when I clic on the word Corollary 3, I go back to bibliography. However with my codes, I must only clic on the number 1 which is in red color. Like this picture

enter image description here

2

Similar to this answer, but we can exploit the fact that hyperref already sets an anchor for all citation entries.

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsthm}
\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}

\makeatletter
\newcommand*{\hyperlinkcite}[2]{%
  \hyper@@link[cite]{}{cite.#1}{#2}}
\makeatother

\begin{document}
\begin{corollary}\label{cor}(\cite[\hyperlinkcite{arendt}{Corollary 3}]{arendt})
  A unilateral weighted shift $T$ on ....
\end{corollary}

By \cref{cor}, there exists a polynomial......

\begin{thebibliography}{10}

  \bibitem{arendt}{W. Arendt, J.R. Goldstein, and J.A. Goldstein:} {Outgrowths
  of Hardy's inequality,} Contemp. Math. 412 (2006), pp. 51-68.

\end{thebibliography}

\end{document}

both the label number and the postnote "Corollary 3" are linked and coloured in red in "[1, Corollary 3]"

If one wanted to do this properly, one would probably have to redefine \cite to also link the postnote argument, but that could end up quite tricky.

  • How would modify that definition of \hyperlinkcite so as to create the postnote equivalent of \textcite? – murray Jan 14 at 15:22
  • @murray Sorry, I don't quite understand. Can you rephrase the question? \hyperlinkcite{<entrykey>}{<arbitrary text>} just prints <arbitrary text> as a hyperlink pointing to <entrykey> in the bibliography. That's why we had to use the slightly redundant \cite[\hyperlinkcite{arendt}{Corollary 3}]{arendt}. As I mentioned in the last paragraph, if one wanted \cite to add the link directly one would have to modify \cite, but I assume there are some subtle issues there w.r.t. postnotes of multiple citations and the definition of \cite can vary wildly with the used citation package. – moewe Jan 14 at 15:26
  • @moewe Thanks a lot for your answer. In view of your remark. I think we can proceed as follows: \definecolor{citeblue}{HTML}{617BAC} \makeatletter \def\ccitecolor{red} \def\ccite{% \@ifnextchar[{\@@ccite}{\@ccite}% } \def\@@ccite[#1]#2{% \hyperlink{cite.#2}{\cite[#1]{#2}}% } \def\@ccite#1{% \hyperlink{cite.#1}{\cite{#1}}% }\makeatother – Student Jan 14 at 17:33
  • @moewe Because I want that the braces [] are always colored. Please correct me if I made wrong. – Student Jan 14 at 17:36
  • @Student On first glance that looks OK. – moewe Jan 14 at 18:59

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.