Tag Info

New answers tagged

2

Option pdfborder is the way to go with hyperref. The "exact" definition of the three values can be found in the PDF specification (units are bp): First value: horizontal corner radius, second value: vertical corner radius, the third value is the line thickness, as forth element, a dash array can be provided. \documentclass{book} \usepackage{hyperref} ...


2

This parameter is controlled by the attribute at PDF low level: attr{/C[red green blue] /Border[0 0 thin]} for example attr{/C[1 0 0] /Border[0 0 .6]} My experiences show that doing this lines thinner than .6 bp makes the lines invisible on some PDF viewers. Unfortunately. So, I advice to make the color less striking.


1

The relevant option should be backref=page, as this inserts the correct links to the page. In addition, the hyperref package should be loaded after the subcaption package, which is not needed in this minimal example at all. \documentclass{report} \usepackage{subcaption} \usepackage[backref=page]{hyperref} \begin{document} \chapter{Loranium} Lorem ...


1

The problem was that I used pstopdf, not ps2pdf. It seems like that TL2014 distribution does not have ps2pdf, so I had to install ps2pdf with ghostscript from brew for Mac OS X. brew install ghostscript


2

You could use the package's \hyperlink and \hypertarget macros. They don't require any counters, \refstepcounter actions, or redefinitions of \@currentlabel. Insert \hypertarget{<anchor name>}{<some text>} in the location to which the reader should jump. Insert \hyperlink{<anchor name>}{<other text>} in one or more locations from ...


3

You need to set an anchor in the appropriate spot. This is done automatically when \refstepcounter is issued, but you have to do it manually when \@currentlabel is set without the help of a counter. An anchor can be set with \phantomsection (it's a bad name, though). \makeatletter \newenvironment{algorithm}[2]% {\medbreak \edef\@currentlabel{#1}% % ...


2

Not introducing a spurious space before the url in the first argument to \href seems to solve the problem. I say 'seems' because I do not have access to that version of Reader or to Windows. Hence, I tested this with an older version on GNU/Linux. However, I reproduced the problem and tested the solution, so I'm guessing it is the same. (If not, let me know ...


3

Set charsize option to 0pt to get auto size for text fields: \TextField[bordercolor=1 0 0,width=10em,charsize=0pt,name=box]{Thisisabox}


3

You don't need it. Only the dvips driver has problems to break links and needs breakurl. xdvipdfmx (used by xetex) works without it: \documentclass{article} \usepackage{hyperref} \textwidth=2cm \begin{document} \url{http://tex.stackexchange.com/questions/218196/breakurl-doesnt-work-with-xelatex} \end{document}


3

i'm not familiar with pdfx, but it presumably takes the place of hyperref. it is, with very few exceptions, necessary for hyperref to be called last. you have pdfx first.


5

\documentclass[hidelinks,12pt]{amsbook} \RequirePackage[bookmarks, bookmarksopen=true, plainpages=false, pdfpagelabels, pdfpagelayout=SinglePage, breaklinks = true]{hyperref} \begin{document} \chapter{Troubleshooting long URLs} \section{Test 1} A complete list of participants and presentations can be found on the conference web site: \href ...


2

Put the url on a separate paragraph and use a \parbox. It also works within a list: \documentclass[hidelinks,12pt]{amsbook} \RequirePackage[bookmarks, bookmarksopen=true, plainpages=false, pdfpagelabels, pdfpagelayout=SinglePage, breaklinks = true]{hyperref} \usepackage{enumitem} \begin{document} \chapter{Troubleshooting long URLs} \section{Test 1} A ...


1

Here's a way using a verbatimbox. \documentclass{article} \usepackage{verbatimbox,hyperref} \begin{document} \begin{myverbbox}{\numpy}n$_umpy\end{myverbbox} And now we \href{www.numpy.org}{\numpy}\,. \end{document}


3

You have to brace \href{www.numpy.org}: \documentclass{article} \usepackage{cprotect} \usepackage{hyperref} \begin{document} With \texttt{\string\verb}: \cprotect{\href{http://www.numpy.org}}{\verb|numpy|} With \texttt{\string\texttt}: \href{http://www.numpy.org}{\texttt{numpy}} \end{document} However, using \cprotect doesn't seem necessary here, as ...


7

\documentclass{article} \usepackage{hyperref} \newcommand\rurl[1]{\xurl#1\empty\empty\empty\empty\empty\xurl} \def\xurl#1#2#3#4#5#6\xurl{% \def\tmp{#1#2#3#4#5}% \href{\ifx\tmp\xurlhttp \else http://\fi#1#2#3#4#5#6}% {\nolinkurl{#1#2#3#4#5#6}}% } \def\xurlhttp{http:} \begin{document} \rurl{ipython.org}\\ \rurl{http://ipython.org} \end{document}


1

Your given error message Argument of \hyper@anchorstart has an extra } let me guess, that you have a problem with a special bib file entry, because your given code and bib file compiles without any error or warning on my current MikTeX 2.9 system. You talked about "errors". So you got more errors? With the given MWE or with your code? First we have to make ...


3

Maybe you can use the current color . defined by the xcolor package: \documentclass{article} \usepackage{xcolor} \usepackage{hyperref} \hypersetup{colorlinks,linkcolor=.,filecolor=.,urlcolor=.,citecolor=.} \begin{document} \section{Section}\label{test} {\color{blue}See \ref{test}}, {\color{orange}see \ref{test}}, see \ref{test} \end{document}


0

If you insist on keeping texlive 2009, install a new hyperref, e.g. from here: http://www.ctan.org/pkg/hyperref You can install into your ~/texmf, and if it doesn't work, simply remove it again. Watch out, if your ~/texmf includes a file ls-R, you have to update it, say texhash ~/texmf.


3

the backref option to hyperref will reference the number of the page on which a citation appeared. there are many questions here that ask about back references, but i couldn't find one that exactly answers this question in a straightforward manner. the question Precise back-reference target with hyperref and backref expounds on exactly where the link arrow ...


4

In short: Omit the curly braces around #1, #2, ... Example: \href{http://stbarnabaschapel.net/asm/proj{#2}.asm} If #2 is foobar, then it expands to: \href{http://stbarnabaschapel.net/asm/proj{foobar}.asm} The curly braces are not going away, because they are not parsed as argument. Thus the curly braces become part of the URL. Also \href{{#1}} is ...


3

You need \usepackage{mathtools} for \begin{align}...\end{align} as well for \text{} (improving non-math-typesetting within formulas). The main issue however is \usepackage{hyperref} for \autoref to work. Compile twice, to see the effect. Edit: My first version of this solution was posted before the OP added his 'MWE', but now it's quite clear, that the ...


3

Adding the afterpage package to your preamble and using \afterpage{\phantomsection\hypertarget{chap2}{}} will create a hypertarget at the top-left corner of the text block on the second page of the chapter: \documentclass{book} \usepackage{hyperref,lipsum,afterpage} \begin{document} \chapter{Chapter 1} \hyperlink{chap2}{Here is the second page of ...


5

No \ifx\\#1\\ with xparse: \documentclass{article} \usepackage{xparse,imakeidx,hyperref} \makeindex \NewDocumentCommand{\textindex}{om}{% #2% \IfNoValueTF{#1} {\index{#2}} {\index{#2|#1}}% } \begin{document} \textindex{Hello} \textindex[textbf]{World} \printindex \end{document} Explanation: the command \textindex has two arguments, one ...


3

The following example works fine: \documentclass{article} \usepackage{makeidx} \makeindex \newcommand{\textindex}[2][]{#2\index{#2% \ifx\\#1\\% % do nothing \else |#1% \fi}} \begin{document} \textindex{Hello} \textindex[textbf]{World} \printindex \end{document} If | is active, then \string helps: \string|% Note, that I have commented ...


0

If you want a different reference specifically for \nameref, then define a new name using the following macro: \makeatletter \newcommand{\namerefname}[1]{\edef\@currentlabelname{#1}}% New \nameref name \makeatother Here's your example showing its usage: \documentclass[twocolumn]{memoir} \usepackage{hyperref} \headnameref % headers ...


2

Two applications of \patchcmd (from the etoolbox package) are sufficent: \patchcmd{\H@old@sectm@m} {\csname #1mark\endcsname{#8}} {\csname #1mark\endcsname{#9}} {}{} \patchcmd{\H@old@sectm@m} {\fi #7} {\fi #9} {}{} Running heads will be the full section title while \nameref maintains its originary functionality: And the TOC entries have the ...


3

Add \urlstyle{rm} to your preamble.


2

This is caused by the frontmatter environment: if there is no frontmatter, links work just fine. In the definition of the environment, they open a NoHyper environment, but they do not close it. Adding \endNoHyper after the frontmatter fixes the problem. There is probably a cleaner solution, patching the environment, but since this environment is only ...


3

The PDF standard does not provide a means for displaying remote images from URLs at viewing time. So \includegraphics cannot embed these. But the Adobe Supplement to the ISO 32000 defines the RichMedia Annotation. It is implemented in AdobeReader on Windows and MacOSX and allows playing media (embedded or from URL). Here is an example, using ...


6

The URL is not specifying a location of an image to TeX, it is specifying what the PDF reader should do when the user clicks on the link. You have \includegraphics{hbv} so tex needs a file of that name in its search path.


2

You can change allcolors to the current color . inside the footline template using \addtobeamertemplate{footline}{\hypersetup{allcolors=.}}{} Code: \documentclass[leqno]{beamer} \usetheme{Madrid} \usecolortheme{whale} \usepackage{lmodern} \hypersetup{colorlinks=true, allcolors=blue} \addtobeamertemplate{footline}{\hypersetup{allcolors=.}}{} ...


1

The problem is not the toc but the bookmarks. You can remove the hebrew with \texorpdfstring. You can enter single hebrew letters in the booksmarks with \unichar (needs the unicode-option): \documentclass{article} \usepackage{cjhebrew} % This package allows you to write in Hebrew. % Write in Hebrew like this: \<hebrew> ...


0

And I've since written a package called latex-markdown-linking to include similar formatting. \usepackage{hyperref} % required by linking.sty \usepackage{linking} % include linking.sty in your compile folder % Markdown equivalent: [Bode Miller]:https://... \SSdefine{Bode Miller}{https://en.wikipedia.org/wiki/Bode_Miller} \begin{document} % Markdown ...


8

In my point of view, it's sufficient to set a \hypertarget{destname}{} and use the destname as argument to the evince --named-dest option. This works at least in my evince version (3.6.1, very old, I believe) It works with Acrobat Reader as well, the calling syntax is slightly different, however: acroread /a "nameddest=pos2" nameddestexample.pdf to ...


4

The following approach (borrowed from egreg's answer) allows you to turn the text of the listing (but not the whole frame/box) into a hyperlink. First, save the listing in an lrbox; then, use the latter in the second argument of \href: \documentclass{article} \usepackage{hyperref} \usepackage{listings} \usepackage{xcolor} \newsavebox\lstA ...


1

I avoid the option clash for hyperref by loading: \usepackage[svgnames]{xcolor} The last package in my preamble is: \usepackage[colorlinks=true, linkcolor=Maroon, urlcolor=Maroon]{hyperref} Obviously, you should use your own preferred colours. I struggled with this for quite a while when I was designing the template for a scholarly journal but after ...


5

\ce breaks in the code that tries to convert it to a bookmark string. With \texorpdfstring an alternative can be provided for the bookmarks: \documentclass{article} \usepackage[version=3]{mhchem} \usepackage[pdfencoding=auto]{hyperref} \usepackage{bookmark} \begin{document} \section{\texorpdfstring{\ce{H2O}}{H\texttwoinferior O}} \end{document} In this ...


4

unfortunately svg loads a load of packages not directly related to svg inclusion itself including subfig which is incompatible with subcaption. You can suppress subfig inclusion by: \documentclass{article} \usepackage{subcaption} \expandafter\def\csname ver@subfig.sty\endcsname{} \usepackage{svg} \usepackage{hyperref} \begin{document} ...


2

The incompatibility here is not with hyperref, but instead with loading two sub-float packages: subcaption and subfig. Since you're using caption already, I'd stick with subcaption rather than subfig. Other suggestions include: Use geometry to set your document layout/dimensions, not a4wide; Don't load packages twice (like amsmath and amssymb); Load ...


2

The end of the ToC clears the page (two pages for two-sided). So the \addcontentsline is being executed when TeX is already on page 7. To avoid this, you can add the contents line first, manually clearing the pages to ensure that the ToC does not need to start a new page: \documentclass{book} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...


0

Ok, I think I got it; first, found like this that \part - or rather \@part - actually has an optional argument: $ texdef -t latex -c book part -f \part first defined in "book.cls". \part: \long macro:->\if@openright \cleardoublepage \else \clearpage \fi \thispagestyle {plain}\if@twocolumn \onecolumn \@tempswatrue \else \@tempswafalse \fi \null \vfil ...


2

This could be a possible solution, by providing a \enhancedpart command, having an 3rd argument containing the bookmark title. Since hyperref automatically adds the bookmarks via \addcontentsline, this has to be kicked out. The bookmark package provides some features, but the destination key has to be set then. This is automatically done using a ...



Top 50 recent answers are included