首页 | 博客群 | 公社 | 专栏 | 论坛 | 图片 | 资讯 | 注册 | 帮助 | 博客联播 | 随机访问
旧欢如梦,往事如歌- -| 回首页 | 2007年索引 | - -访问量过一万了

Latex中的超链接

关键词latex    超链接    hyperref    参考文献    目录                                          

==========  转载请注明本站URL地址  ===============

在Latex生成的pdf文档中建立超链接(如从正文到参考文献,从目录到相应内容,从页码编号到实际页面等),有利于读者快速定位当前阅读的信息。

如何在生成的pdf文件中包含超链接呢?需要注意一下两点:

1. 使用“hyperref”这个宏包,即在latex文档的导言部分添加“\usepackage{hyperref}”;
2. 使用“PdfLatex”对latex源文件进行编译,不要用“Latex”编译。

这样能确保生成的pdf文件中包含有可以用鼠标进行点击的超链接。但是这样存在一个问题,就是这些包含超链接的文本周围会出现彩色的方框,这种方框实在有碍观瞻,尤其是当出现在目录中时,大片的方框非常难看。

客服以上问题的方法是,不要使用“hyperref”宏包的默认属性,即使用如下方式引入宏包:

\usepackage[colorlinks,linkcolor=red,anchorcolor=blue,citecolor=green]{hyperref}

“colorlinks”的意思是将超链接以颜色来标识,而并非使用默认的方框来标识。
linkcolor, anchorcolor, citecolor分别表示用来标识link, anchor, cite等各种链接的颜色。
若正式的文档中不想使用彩色的标识,但又希望具有超链接的功能,则将上例中的各种颜色换成“black”即可。

选项中可供设置的常用选项见下表:

Extension options

extension text

Set the file extension (e.g. dvi) which will be appended to file links created if you use the xr package.

hyperfigures boolean

backref boolean false

Adds ‘backlink’ text to the end of each item in the bibliography, as a list of section numbers. This can only work properly if there is a blank line after each \bibitem.

pagebackref boolean false

Adds ‘backlink’ text to the end of each item in the bibliography, as a list of page numbers.

hyperindex boolean true

Makes the page numbers of index entries into hyperlinks. Relays on unique page anchors (pageanchor, ...)

pageanchors and plainpages=false.
hyperfootnotes boolean true

Makes the footnote marks into hyperlinks to the footnote text. Easily broken ...

encap

Sets encap character for hyperindex

linktocpage boolean false

make page number, not text, be link on TOC, LOF and LOT

breaklinks boolean false

allow links to break over lines by making links over multiple lines into PDF links to the same target

colorlinks boolean false

Colors the text of links and anchors. The colors chosen depend on the the type of link. At present the only types of link distinguished are citations, page references, URLs, local file references, and other links.

linkcolor color red

Color for normal internal links.

anchorcolor color black

Color for anchor text.

citecolor color green

Color for bibliographical citations in text.

filecolor color magenta

Color for URLs which open local files.

menucolor color red

Color for Acrobat menu items.

runcolor color filecolor

Color for run links (launch annotations).

urlcolor color cyan

Color for linked URLs.

frenchlinks boolean false

use small caps instead of color for links

更详细的信息,请参考 Hypertext marks in LATEX: a manual for hyperref (http://www.tug.org/applications/hyperref/manual.html)

【作者: xqscorpion】【访问统计:】【2007年05月29日 星期二 23:47】【注册】【打印

搜索

Google

Trackback

你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=6300678

回复

- 评论人:eagle   2008-02-27 10:14:58   

你好,谢谢解决hyperref问题。

验证码:   
评论内容: