
Quero fazer de toda a citação um link para a entrada bibliográfica correspondente, em vez de apenas o número.
Quero também apresentar o argumento opcional de \cite
parte deste link.
Meu MWE:
\documentclass[12pt,a4paper]{article}
%------------------------------------------------------------
\usepackage{amsmath,amssymb,amsthm}
%------------------------------------------------------------
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[colorlinks=true,pagebackref=true]{hyperref}
\hypersetup{urlcolor=blue, citecolor=red, linkcolor=blue}
% ------------------------------------------------------------
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{definitions}{Definitions}[section]
\newtheorem{notation}{Notation}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{example}{Example}[section]
\numberwithin{equation}{section}
\begin{document}
By \cite[Theorem2.1]{4}, the A-covariance operator
\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}
Gostaria que o resultado do \cite
comando fosse algo assim:
Responder1
Fiz uma pequena pesquisa e não encontrei nenhuma maneira de fazer o que você deseja com um método pronto para uso.
Fiz algo, mas não é bonito e podem ocorrer erros.
(Quase) como disse Donald Knuth:
Cuidado com os bugs no código abaixo; Eu apenas testei, não provei que estava correto.
:P
Eu defini um novo comando \ccite
. Istodevefunciona exatamente como o \cite
comando padrão. O \ccite
comando é um wrapper para o \cite
comando real que chama o último dentro de um arquivo \hyperlink
.
O \hyperlink
usa a cite.<citation-name>
tag para fazer o hiperlink para a bibliografia e anexa o link ao \cite
comando.
O \ccite
comando funciona com o argumento opcional do \cite
comando, e também funciona caso a bibliografia seja construída com bibTeX. Eu não testei com bibLaTeX.
Observação:Como o hiperlink é feito com um comando de citaçãoecom um comando de vinculação, a cor da citação completa é fornecida pela opção citecolor
e linkcolor
de hyperref
.
Então aqui está:
\documentclass[12pt,a4paper]{article}
%------------------------------------------------------------
\usepackage{amsmath,amssymb,amsthm}
%------------------------------------------------------------
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\definecolor{citeblue}{HTML}{617BAC}
\usepackage[colorlinks=true,pagebackref=true]{hyperref}
\hypersetup{urlcolor=blue, citecolor=citeblue, linkcolor=citeblue}
% ------------------------------------------------------------
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{definitions}{Definitions}[section]
\newtheorem{notation}{Notation}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{example}{Example}[section]
\numberwithin{equation}{section}
\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
\begin{document}
By \ccite{4}, the A-covariance operator
By \ccite[Theorem 2.1]{4}, the A-covariance operator
By \textcolor{citeblue}{\cite[Theorem 2.1]{4}}, the A-covariance operator
\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}