One of the tips of latex: Establishing a hyperlink to a reference _ document

Source: Internet
Author: User

In latex, the reference link is established to facilitate the reader to quickly locate the reference document and obtain the information of reference documents.

To this end, we need to pay attention to 2 points: (1) need to introduce HYPERREF macro package; (2) do not generate PDF files in latex-->dvips-->ps2pdf way.

When introducing a macro package, you can import the Hyperref macro package with the following statement:
\usepackage[colorlinks, Citecolor=red]{hyperref}
Then compile with the Pdflatex command, so the generated PDF file in red font to indicate the reference file number, click on the serial number, you can link to the article after the reference file.

The Colorlinks option indicates that when the reference number is displayed, the color is used as the identification and, if not, the default box is used to display the ordinal number. The Citecolor option represents the color that displays the number of reference documents, and the default is green.

How do I include a hyperlink in a generated PDF file? Need to pay attention to two points:

1. Use the "HYPERREF" macro package, that is, add "\usepackage{hyperref}" in the introductory section of the Latex document;
2. Use "Pdflatex" to compile Latex source files, do not compile with "Latex".

This ensures that the resulting PDF file contains a hyperlink that you can click with your mouse. But there's a problem with the fact that there are colored squares around the text that contains hyperlinks, which are really unsightly, especially when they appear in the table of contents.

The way to do this is to not use the default property of the "HYPERREF" macro package, which is to introduce a macro package in the following ways:

\usepackage[colorlinks,

Linkcolor=red,

Anchorcolor=blue,

CITECOLOR=GREEN]{HYPERREF}

"Colorlinks" means to identify the hyperlink by color instead of using the default box.
LinkColor, Anchorcolor, citecolor are used to identify the colors of link, anchor, cite, and so on.
If the formal document does not want to use the color of the logo, but also want to have a hyperlink function, the above example of the various colors to "black" can be.

If you are in the PDF production of the document signed with garbled following command, OK

\USEPACKAGE[DVIPDFM,%pdflatex,pdftex here decide how to run the file differently
Pdfstartview=fith,
Cjkbookmarks=true,
Bookmarksnumbered=true,
Bookmarksopen=true,
Colorlinks,% comment out this item is cross-referenced to a colored border (colorlinks and Pdfborder are commented out)
pdfborder=001,% comment out this item is cross-referenced to a colored border
Linkcolor=green,
Anchorcolor=green,
Citecolor=green
]{HYPERREF}

If the formal document does not want to use the color of the logo, but also want to have a hyperlink function, the above example of the various colors to "black" can be.
\href{url}{text}
\url{url}
\nolinkurl{url}
\hyperbaseurl{url}
\hyperimage{imageurl}{text}
\hyperdef{category}{name}{text}
\hyperref{url}{category}{name}{text}
\hyperref[label]{text}
\hyperlink{name}{text}
\hypertarget{name}{text}
\phantomsection
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{\indexname}
\printindex
\autoref{label}

\url{Web site}: Generate URL links to the same wide font layout; \href{URL {description}: Generate URL link, display description in normal font, hide URL.

The most common options available for setting in the options are shown in the following table:

Extension Options

Extension Text

Set thefile extension (e.g. DVI) which'll is appended Tofile links created if you use the xrpackage.

Hyperfigures Boolean

Backref Boolean False

Adds ' backlink ' text to the "End of" the bibliography, as a list of section numbers. This can only work properly if there be a blank line after each \bibitem.

Pagebackref Boolean False

Adds ' backlink ' text to the "end of" 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 the 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, is 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 type of link. At present to types of link distinguished are citations, page references, URLs, Localfile references, and other link S.

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 localfiles.

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

For more information, refer to:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.