为章节编号和链接添加框

为章节编号和链接添加框

我如何才能获得屏幕截图中显示的方框?我只想要章节和图号中的方框。引用也一样,而不是目录中的方框。

在此处输入图片描述

在此处输入图片描述

\begin{document}

\section{First section}

This document is an example of \texttt{thebibliography} environment using 
in bibliography management. Three items are cited: \textit{The \LaTeX\ Companion} 
book \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and the 
Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are
\cite{latexcompanion,knuthwebsite}. 

\medskip

\begin{thebibliography}{9}
\bibitem{latexcompanion} 
Michel Goossens, Frank Mittelbach, and Alexander Samarin. 
\textit{The \LaTeX\ Companion}. 
Addison-Wesley, Reading, Massachusetts, 1993.

\bibitem{einstein} 
Albert Einstein. 
\textit{Zur Elektrodynamik bewegter K{\"o}rper}. (German) 
[\textit{On the electrodynamics of moving bodies}]. 
Annalen der Physik, 322(10):891–921, 1905.

\bibitem{knuthwebsite} 
Knuth: Computers and Typesetting,
\\\texttt{http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html}
\end{thebibliography}

\end{document}

答案1

由于使用hyperref包而出现标记的框:

\documentclass{book}
\usepackage[linktocpage=true]{hyperref}

\begin{document}

\tableofcontents

\section{Test}\label{sec:1}

This is for test \ref{sec:1}

This is for reference test \cite{ref1}

\begin{thebibliography}{1}
\bibitem{ref1} This is for checking purpose only
\end{thebibliography}

\end{document}

输出

在此处输入图片描述

相关内容