我怎样才能隐藏文档中的一个链接?(我希望能够创建一个“秘密链接”,就像复活节彩蛋一样,读者如果仔细观察就能找到。)
\documentclass{article}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}
\href{https://www.google.com/}{This link is colored blue.}
\hypersetup{hidelinks}
\href{https://www.google.com/}{This is a hidden link, not colored.}
\hypersetup{hidelinks = false} % This doesn't work
\href{https://www.google.com/}{I want this link to not be hidden, like the first one.}
\end{document}
答案1
使用组而不是重置密钥。分组限制了值分配的范围。
\documentclass{article}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\begin{document}
\href{https://www.google.com/}{This link is colored blue.}
\begingroup
\hypersetup{hidelinks}
\href{https://www.google.com/}{This is a hidden link, not colored.}
\endgroup
\href{https://www.google.com/}{I want this link to not be hidden, like the first one.}
\end{document}