Hi I'm using a RevTex template and I would like to create a reference for a single word for instance 'molecule'. So i would like to use the reference for this word everytime I should write the word molecule. For example the phrase is:'The molecule is toxic' I tried:
molecule\label{a}
The \ref{a} is toxic.
I also tried the solution here Label a word or sentence?, but it doesn't work well, I observe these problems: -It references the word but the word is in another color -It changes also the color of other references made just with '\label{} + \ref{}, so the reference of equations for example appears red or green -It changes also the dimension of my entire text This is the code:
\documentclass[reprint,amsmath,amssymb,aps,]{revtex4-2}
\usepackage{graphicx}
\usepackage{dcolumn}
\usepackage{bm}
\usepackage[a6paper]{geometry}
\usepackage[colorlinks]{hyperref}
\makeatletter
\newcommand{\setword}[2]{%
\phantomsection
#1\def@currentlabel{\unexpanded{#1}}\label{#2}%
}
\makeatother
\begin{document}
\section{\label{sec:level1}example}
This is an example how to reference a word 'molecule'.
So I fixed the word '\setword{molecule}{Word:molecule}' and I try to use it again\
The \ref{Word:molecule} is toxic
\begin{eqnarray}\label{eq}
dV=Cd
\end{eqnarray}
As you can see in equation(\ref{eq})
\begin{eqnarray}\label{eq1}
dV=Cds
\end{eqnarray}
As you can see in equation(\ref{eq1})
\end{document}
here there's my initial test:
And this is what happen when I use the suggestion Label a word or sentence?:
Is there a way how to fix it?


colorlinkspassed tohyperref. Just remove it. – campa Jan 28 '21 at 09:43\usepackage[a6paper]{geometry}is not necessary; egreg used it only to have a more readable snapshot. Remove it. – campa Jan 28 '21 at 12:49