1

How can I put or resize a fbox to fit a reference \cite{author} like this?

enter image description here

\usepackage{xcolor}
\usepackage[hidelinks]{hyperref}
\begin{document} 
\newcommand{\cfbox}[2]{%
\colorlet{currentcolor}{.}%
{\color{#1}%
\fbox{\color{currentcolor}#2}}%
}
\hypersetup{backref=true,       
pagebackref=true,               
hyperindex=true,                
colorlinks=true,                
breaklinks=true,                
urlcolor= black,                
linkcolor= blue,                
bookmarks=true,                 
bookmarksopen=false,
filecolor=black,
citecolor=black,
linkbordercolor=blue
}
\end{document}
citecolor green citation links (bibliography) \cfbox{green}{\cite{bib00}}

Output: citecolor green citation links (bibliography) enter image description here

1
  • Welcome to TeX.SE!
    – Mensch
    Jul 5, 2021 at 22:04

1 Answer 1

1

Since you employ the hyperref package, you might as well let it do the job of drawing frame lines around numeric-style citation call-outs.

enter image description here

\documentclass{article}
\usepackage[pdfborder={0 0 0.4}]{hyperref} % '0.4': width of frame line, in pts

\begin{document}
\cite{aaa}

\begin{thebibliography}{1}
\bibitem{aaa} AAA
\end{thebibliography}
\end{document}
3
  • Thank you for the feedback. I tried your solution but it doesn't work. Since I am a beginner on latex. I used this template overleaf.com/latex/templates/… but its problem is there are missing packages. Jul 6, 2021 at 14:40
  • @кестеняво - Sorry, but remarks such as "it doesn't work" are not actionable. If my proposed solution doesn't work for you, it must be because your document employs a different setup. Sadly, but maybe not surprisingly, my mind-reading and divination skills are just rubbish, and the chances that I'll successfully guess on my own what your document setup looks like are nil. Unless you tell us fairly specifically what "it doesn't work" entails -- error messages? warning messages? something else? -- chances that anybody will be able to come up with a diagnosis, let alone a cure, are rather poor.
    – Mico
    Jul 6, 2021 at 15:07
  • I totally agree with you. except that I did not receive an error message and during the execution nothing changes for the references. Also I agree that this Template overleaf.com/latex/templates/… uses a different configuration. Jul 6, 2021 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .