我知道要隐藏内部链接周围的边框,hidelinks
始终可以选择:
\usepackage[hidelinks]{hyperref}
但是如果我hyperref
只需要第 2 部分的丑陋边框,而不需要第 1 部分或第 3 部分的丑陋边框,该怎么办?
\section{AAA}
Hyperlinks here should not have ugly borders
\section{BBB}
Hyperlinks here must have ugly borders
\section{CCC}
Hyperlinks here should not have ugly borders
答案1
您可以使用下列键打开/奇数边框pdfborder
:
\documentclass{article}
\usepackage{hyperref}
\newcommand{\nolinks}{\hypersetup{pdfborder={0 0 0}}}
\newcommand{\showlinks}{\hypersetup{pdfborder={0 0 1}}}
\begin{document}
\section{AAA}\label{AAA}%
\nolinks
Hyperlinks here should not have ugly borders \ref{BBB}.
\section{BBB}\label{BBB}%
\showlinks
Hyperlinks here must have ugly borders \ref{CCC}.
\section{CCC}\label{CCC}%
\nolinks
Hyperlinks here should not have ugly borders \ref{AAA}.
\end{document}