I want to color the brackets of inline citation like: some text[9] where it is written in latex like this some text\cite{9}
. Now hyperref only colors the number "9" without the brackets "[]". Is there any workaround for this?
1 Answer
You can use the cite
package:
\documentclass{article}
\usepackage{color}
\usepackage{hyperref}
\usepackage{cite}
\renewcommand{\citeleft}{\textcolor{red}{[}}
\renewcommand{\citeright}{\textcolor{red}{]}}
\begin{document}
Hello \cite{world}!
\begin{thebibliography}{99}
\bibitem{world} created some time ago
\end{thebibliography}
\end{document}
-
2This doesn't solve the issue, if you do something like \cite[Example 1]{world}. Feb 6, 2018 at 14:03
text~\cite{id}
, this inserts a blank space between the text and the citation which will not be broken by a line break.\documentclass{...}
and ending with\end{document}
.\cite{paper1,paper2,paper8}
, and these would have to link to different places, it doesn't make much sense to include the brackets in the link area.[1-5]
if you load certain citation styles, standardplain
will print[1,3,2,5,4]
and each reference will be linked. If you add a minimal working example as Marco Daniel requests, you tell us which packages and citation styles you are using and we can better answer your question.