Tag Info

Hot answers tagged

79

\hypersetup{ colorlinks=false, pdfborder={0 0 0}, } Edit: Fortunately, this is no longer needed. Since 2011-02-05 (hyperref version 6.82a), you can use the hidelinks option to achieve the same result; see this answer.


74

I use something like \usepackage{xcolor} \hypersetup{ colorlinks, linkcolor={red!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black} } This gets rid of the ugly color boxes, but uses dark colored fonts which still make it clear that they are clickable.


45

The \phantomsection command is nessesary for hyperref to jump to the correct page, in other words it puts a hyper marker on the page. For example a starred section or chapter added to the TOC would normally refer to the wrong place without \phantomsection \chapter*{Extended Summary} \phantomsection \addcontentsline{toc}{chapter}{Extended Summary}% ...


44

Well, I see there are a lot of answers already, and they work, however I thought I'd give more detail: As above, you can use \usepackage[hidelinks=true]{hyperref} or \hypersetup{hidelinks=true} However, if your problem is with the ugly green boarder there are very nice ways to remove that, without making it unclear what is a hyperlink. I like ...


26

Here's a new TikZ style called hyperlink node=<target> that takes a hypertarget reference. It works by measuring the node it is supplied to, and then placing a new invisible node on top of that. The new node has the content \hyperlink{<target>}{\phantom{\rule{<width of node>}{<height of node>}}, so it has the same size as the original ...


23

You can load the package caption. The default setting is hypcap=true. If you don't load the package caption, you can load the package hypcap. It is important that the package is loaded after hyperref. You can load hypcap with the option all. In this case hypcap has an influence on all float environments. You can limit it to figures by setting the option ...


21

You should use the hyperref package (which uses url internally but improves on it). It will not only format the link but also place a real hyperlink into the PDF. With url alone the link is only normal text, but is probably recognized as hyperlink by your PDF viewer, but with the wrong code for ~. LaTeX tends to substitute the code of these special ...


20

No. Placed there the command \sloppy has no effect: \documentclass{article} \usepackage{hyperref} \usepackage[width=7cm]{geometry} \begin{document} If you are interested to know the details, please contact me at {\sloppy \href{mailto:asdfkoafdkfaldfkafsdfkdf@kdsoffkdlfasdfjaldf.xxx} {asdfkoafdkfaldfkafsdfkdf@kdsoffkdlfasdfjaldf.xxx}}. If you are ...


19

I am providing a different answer to this question because the original answer is out of date. The \phantomsection command is needed to create a link to a place in the document that is not a figure, equation, table, section, subsection, chapter, etc. This is mostly used in conjunction with \addcontentsline or with \label and \hyperref. For example, the ...


17

With the option hypertexnames hyperref uses the corresponding counter in addition to the link type to construct the link name. Imagine, you have two chapters and one section in each chapter plus one table. The link names would be: With hypertexnames: chapter.1 section.1.1 table.1.1 chapter.2 section.2.1 Without hypertexnames: chapter.3 section.4 table.5 ...


17

I usually write something like this, so the entry is hyperlinked for onscreen reading but there's also a footnote to the URL for paper output. \documentclass{article} \usepackage{hyperref} \newcommand\fnurl[2]{% \href{#2}{#1}\footnote{\url{#2}}% } \begin{document} hello \fnurl{Google}{www.google.com} \end{document}


16

You can not simply mix two PDF files. You have to preserve PDF document structure. In the simply case links (PDF annotations) are dropped. You can try the PAX project, which trys to extract and reinsert the PDF annotations.


16

user14996 wrote: (a) Is is possible to have certain hyperref-hyperlinks [...] point to the very left border of the page, not to the interior? and (b) If, in addition, one could make hyperlinks point not only to the left page border but also to the top left corner of the respective page, that would be a useful option. [...] First I agree with ...


15

\href takes two arguments, \href[options]{URL}{text} where the first is a full URL and the second the link text, and formats the text as normal text (see http://www.tug.org/applications/hyperref/manual.html#x1-130004 for details). So you can fix your problem by adding a full URL in the first argument and adding a second argument, i.e. ...


12

That is because moderncv.cls sets pdfborder to 0 0 0 at the beginning of the document; here's the relevant code: \AtEndPreamble{ \@ifpackageloaded{CJK} {\RequirePackage[CJKbookmarks]{hyperref}} {\RequirePackage[pdftex]{hyperref}} \AtBeginDocument{ \hypersetup{ breaklinks, baseurl = http://, pdfborder = 0 0 0, ...


11

It seems that pdftex always drops all PDF annotations (which includes hyperlinks) from the included file. The PDF format itself makes it rather difficult to do otherwise. PDF annotations are laid out in a completely different way to how the rest of the content of the page is constructed. They live on a different layer and they are positioned using a ...


11

(for reference the Adobe Knowledge base entry about pdf from html linking) Checkout section 4.1 in Hypertext capabilities with pdfLaTeX (F. Garcia, TUGBoat, Vol. 28, No. 1, 2007), which describes the hyperdef and hyperref commands. Just a small example: src.tex: \documentclass{article} \usepackage{hyperref} \begin{document} \section{Source a} ...


11

The hyperref options can be configured using the \hypersetup command and colors are enabled by colorlinks=true. A MWE is below. citecolor is set to gray. For the table of contents link colors, linkcolor is set to green before the \tableofcontents command. Similarly for the list of figures, linkcolor is set to red before the \listoffigures command. Later ...


10

Links jump to the last anchor. Normally hyperref inserts such anchors at sensible places, but if you want a specific location you must do it yourself. \documentclass{article} \usepackage{hyperref,lipsum} \begin{document} \section{ABC} \lipsum[1] ANCHOR\label{A}\phantomsection\label{B} \lipsum[2] \newpage A: \ref{A} to section title B: \ref{B} to ANCHOR ...


10

There are two main purposes for using colored text in documents: style (make the document look more visually pleasing or adequate to its context) and readability (help the reader to understand its meaning). For hyperlink colors, one also has to distinguish between digital and printed documents: the special meaning only makes sense in digital. Regarding ...


10

This is the normal Table Of Content you get while using \tableofcontents To achieve the links you need to use the hyperref package \usepackage{hyperref} A full example would look like this: \documentclass{article} \usepackage{hyperref} \begin{document} \tableofcontents \section{foo} \subsection{bar} \section{foo 2} \subsection{bar 2} ...


10

The two links are created by the command \hyper@natlinkbreak, which is defined by hyperref.sty. To remove the break you can revert back to the provisional definition from natbib.sty by inserting the following lines into your preamble: \makeatletter \renewcommand\hyper@natlinkbreak[2]{#1} \makeatother The results with this simple fix aren't great; links ...


10

You can mark the line numbers so that they are not copied, i.e. an empty text is copied instead, using the technique described in Is it possible to provide alternative text to use when copying text from the PDF?. The required code can be added using the numberstyle option if listings, as shown below. If you want to add other formatting macros to the numbers ...


10

The PDF format knows nested actions. hyperref supports this by option nextacrtionraw for \href in some rudimentary manner: \documentclass{article} \usepackage{hyperref} \begin{document} \href[% nextactionraw={% <<% /Type/Action% /S/URI% /URI(http://meta.tex.stackexchange.com/)% >>% }% ...


9

Quoting the pdfpages manual (page 2): [...] all kinds of links1 will get lost during inclusion. (Using \includepdf, \includegraphics, or other low-level commands.) However, there's a gleam of hope. Some links may be extracted and later reinserted by a package called pax which can be downloaded from CTAN [3]. Have a look at it! The pax ...


9

If you don't use hyperref: \documentclass{article} \usepackage{color} \usepackage[normalem]{ulem} \usepackage{url} \DeclareUrlCommand\ULurl{% \renewcommand\UrlFont{\ttfamily\color{blue}}% \renewcommand\UrlLeft{\uline\bgroup}% \renewcommand\UrlRight{\egroup}} \begin{document} \ULurl{http://foo.bar/%12%34} \end{document} If you use hyperref, you ...


9

Use blue for any link you want your reader to immediately understand it is a link and do not change colors based on type unless it is black. The journal articles I read are mainly in solid state physics and come from an IEEE format or one from the AIP. Even with overlapping content the style for hyperlinks is different. If you look at the IEEEtran ...


9

If you don't want BibTeX to print out the URL field for a given entry even though a URL field is present, you need to edit the bibliography style file -- in the present case, the file IEEEtran.bst -- to disable this printing. Make a copy of the file IEEEtran.bst and call it, say, myIEEEtran.bst. Open the new file in a text editor and search for the function ...


8

This is all I can say without an MWE. Maybe it works for you. \documentclass{article} \usepackage{hyperref, etoolbox} \newtoggle{supervisor} %\toggletrue{supervisor} \newcommand{\myhref}[2]{% \iftoggle{supervisor}% {\href{#1}{#2}}% {#2}% } \begin{document} PhD student at the \myhref{http://www.weizmann.ac.il/}{Weizmann Institute of Science} ...


8

It works with luatex. However, it is not considered to be stable. Here a context example: \setupinteraction [state=start] \starttext \startbuffer [internal] \setupinteraction [state=start] \starttext \useURL [aurl] [http://xkcd.com/149/] [] [I prefer hot dogs.] \from [aurl] \stoptext \stopbuffer \savebuffer [internal] ...



Only top voted, non community-wiki answers of a minimum length are eligible