2012-12-04 11:25 阅读 822 次 评论关闭



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




linkcolor, anchorcolor, citecolor分别表示用来标识link, anchor, cite等各种链接的颜色。

If you need to make references to URLs, or write explicit links, the following low-level user macros are provided:


The text is made a hyperlink to the URL; this must be a full URL (relative to the base URL, if that is defined). The special characters # and ~ do not need to be escaped in any way.


Similar to \href{URL}{\nolinkurl{URL}}. Depending on the driver \href also tries to detect the link type. Thus the result can be a url link, file link, …


Write URL in the same way as \url, without creating a hyperlink.


A base URL is established, which is prepended to other specified URLs, to make it easier to write portable documents.


The link to the image referenced by the URL is inserted, using text as the anchor.

For drivers that produce HTML, the image itself is inserted by the browser, with the text being ignored completely.


A target area of the document (the text) is marked, and given the name category.name


text is made into a link to URL#category.name


text is made into a link to the same place as \ref{label} would be linked.



A simple internal link is created with \hypertarget, with two parameters of an anchor name, and anchor text. \hyperlink has two arguments, the name of a hypertext object defined somewhere by \hypertarget, and the text which be used as the link on the page.

Note that in HTML parlance, the \hyperlink command inserts a notional # in front of each link, making it relative to the current testdocument; \href expects a full URL.


This sets an anchor at this location. It works similar to \hypertarget{}{} with an automatically choosen anchor name. Often it is used in conjunction with \addcontentsline for sectionlike things (index, bibliography, preface). \addcontentsline refers to the latest previous location where an anchor is set. Example:


Now the entry in the table of contents (and bookmarks) for the index points to the start of the index page, not to a location before this page.


This is a replacement for the usual \ref command that places a contextual label in front of the reference. This gives your users a bigger target to click for hyperlinks (e.g. ‘section2’instead of merely the number ‘2’).

The label is worked out from the context of the original \label command by hyperref by using the macros listed below (shown with their default values). The macros can be (re)defined in documents using \(re)newcommand; note that some of these macros are already defined in the standard document classes. The mixture of lowercase and uppercase initial letters is deliberate and corresponds to the author’s practice.




转载请注明:【latex学习资料】Latex中的超链接(资料下载) | 猎微网