New answers tagged

2

Until a proper answer comes along, you might consider using this quick and dirty trick: \hyperlink{some label}{\textcolor{normal text.fg}{link text}} If you use it very often, then create a command for it: \newcommand\myhlink[2]{\hyperlink{#1}{\textcolor{normal text.fg}{#2}} MWE \documentclass{beamer} \hypersetup{colorlinks=true} ...


5

This creates 6 hyperlinks along the first edge which link to the second slide. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{frame}{First} \begin{tikzpicture}\label{picture:first} \node (A) {$A$}; \node (B) [below right=2 and 3 of A] {$B$}; \path (A) edge [line width=5pt] node [pos=0, circle] ...


1

The name={...} option to the definition in the \declaretheoremstyle command defaults to the theorem name, or it's possible to say name={} to remove the prefix in the List of Theorems, but this has an effect to the body-text display as well. (It's not the best solution) The parentheses can be removed by redefining \thmtformatoptarg to be ...


3

Greek letters can also be used in bookmarks: Unicode encoding is needed, because the 8-bit PDFDocEncoding does not contain all letter and symbols. This can be achieved by option unicode or pdfencoding=auto. Option psdextra redefines lots of math symbol commands to work within bookmarks. Example: \documentclass[12pt]{article} \usepackage[ ...


11

The following produces a more readable PDF file: \pdfobjcompresslevel=0 \documentclass{article} \usepackage{hyperref} \begin{document} \href{chrome://zotero/content/tab.xul}{Zotero}% \end{document} Page streams are still compressed, but the link is stored in an uncompressed annotation object in the PDF file. The file can be inspected by a text viewer (or ...


4

A simple solution is to gobble math with \pdfstringdefDisableCommands: \documentclass{article} \usepackage{hyperref} \makeatletter \pdfstringdefDisableCommands{\let\(\fake@math} \newcommand\fake@math{}% just for safety \def\fake@math#1\){[math]} \makeatother \begin{document} \section{\(I\) cast warnings but I wish I wouldnt} ...


2

You should use cleveref, it's much more powerful. I used the patches from my other answer \documentclass[12pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage[titles]{tocloft} \usepackage{xpatch} %%% patches to \@part and \@chapter must %%% be done before loading hyperref \makeatletter \patchcmd{\@part} ...


2

I found a way of doing it : \hyperref[<part label>]{Partie \Roman{part}} is doing the job, then I just have to redefine a new command for it. Yes this in not elegant since there will be \autoref in the text and \MyCommand for parts. Still if there is better, let me now :)


3

Don't use \hspace in a \the... command -- it screws up references (formats) \documentclass[12pt,a4paper]{book} % Ecrire en français \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{lmodern} \usepackage{xspace} % Pour les espaces automatiques % Part name in TOC \usepackage{tocloft} ...


1

You can change the settings locally using { \hypersetup{linkcolor=black} \tableofcontents } or { \hypersetup{hidelinks} \tableofcontents } Code: \documentclass{report} \usepackage{blindtext}% dummy text \usepackage{amsmath} \usepackage{hyperref} \hypersetup{ colorlinks=true, % make the links colored } \begin{document} { ...


2

Here's the basic method: \documentclass{book} \usepackage{pdfpages} \begin{document} \tableofcontents \chapter{ch} \section{sec} text \clearpage \addcontentsline{toc}{section}{xsec} \includepdf{mypages} \end{document} Obviously if you want a numbered section etc. that needs to be specified. However, that really wouldn't make sense, so hopefully that's ...


2

With \RenewDocumentEnvironment it's possible to access the #1 parameter in the end - code of the solution environment. \documentclass[10pt,A4paper]{article} \usepackage{answers} \usepackage{amsthm} \usepackage{tcolorbox} \usepackage{ifthen} \usepackage{tikz} \usepackage{xparse} \usepackage{hyperref} \usetikzlibrary{shadows} \tikzstyle{buttonstyle} = ...


3

To get the "Back to..." button at the end of the solution, one has to use the tail end of the environment defnition of mySoln. However, one cannot employ #1 style parameters in the tail end, and so I save #1 as \tmpmysoln in the front end of the environment, and then use it in the tail end. As to the other part of the question, I have no idea how to ...


0

Here is an answer which depends heavily on the work done in User Mico's answer, but instead; whenever a \hyperlink (linking to a certain \hypertarget) is inserted, the title of that target (the second argument of \hypertarget) is automatically used as a second argument for that \hyperlink, by adding the following excerpt of code: \makeatletter ...


0

Since polyglossia allows unicode characters, the name Apéndice as content of \appendixname causes a problem for the hyperanchor that is to be set for the correct linking. The appendix package defines \Hy@chapname to be \appendixname, which is Apéndice in this case → 'wrong'. Redefining \Hy@chapname cures the problem -- just use a anchorname with 'regular' ...


1

Here's a solution that makes use of the \hypertarget/\hyperlink machinery of the hyperref package to create cross-referencing links. The \hypertarget macro places the "anchor", and the \hyperlink macro generates a call-out (in the form of a hyperlink) to the anchor generated by \hypertarget. Both macros take two arguments: the first is the "anchor text" ...


3

Here's a version with tikz nodes overlaying an image and placing \hyperlinks with \nameref{...} to the sections: The node positions are up to the user! \documentclass[oneside]{article} \usepackage{blindtext} \usepackage{tikz} \usepackage{graphicx} \newcommand{\namereflink}[1]{% \nameref{#1}% % Or use % ...


2

Resetting counters of the sectioning structure by hand must confuse hyperref since it generates anchors from the counter values. E.g. a anchor name could be part.1. However, this will appear again for the Addendum part, even if \thepart is redefined to be \Alph{part} -- the anchor name is generated of a special command named \theHpart etc. If this gets a ...


7

There is no problem, generally, when \href{http://www.example.com/A%20B%20C.pdf}{some text} appears by itself, that is, not in the argument to a macro, because \href suspends the usual TeX's reading rules when absorbing the URL. However, something like \mbox{\href{http://www.example.com/A%20B%20C.pdf}{some text}} would give troubles (\mbox is used to ...


2

You can use named colors and change them in the document: \documentclass{article} \usepackage{xcolor} \colorlet{mylinkcolor}{red!80!black} \colorlet{myurlcolor}{green!50!black} \colorlet{mysectioncolor}{blue!50!black} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ colorlinks=true, linkcolor=mylinkcolor, urlcolor=myurlcolor, ...


0

The problem with breakurl package is that it seems incompatible with PDFLaTeX, and XeLaTeX. My colleague Dag Langmyhr pointed out that the url package is compatible with hyperref if it is loaded before the latter, and consequently \usepackage[T1,hyphens]{url} \usepackage[colorlinks,urlcolor=blue]{hyperref} does the job more elegantly (breaklinks=true did ...


4

You can call \hypersetup{hidelinks} in the "before" part of \titleformat, as this will only affect the section title locally: \documentclass{article} \usepackage{fontspec} \usepackage{xcolor} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ colorlinks=true, linkcolor=red!80!black, urlcolor=green!50!black, hyperfootnotes=false, ...


2

Floating environments for non-floating stuff is not the right choice here. Images can be easily imported enlarged and centered on the page via package pdfpages: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{pdfpages} \usepackage{tikz} \usepackage{hyperref} \usepackage{bookmark} \pagestyle{empty} ...


3

Since @egreg already explained what the issue is – here is a suggestion which circumvents the problem: \documentclass{article} \usepackage{expl3,xparse,hyperref} \ExplSyntaxOn % this saves the url with all characters catcode other: \str_const:Nn \c__npkg_standard_url_str { http://www.ctan.org/pkg/ } % separate formatting: \cs_new_protected:Npn ...


0

As a workaround I got the idea to generate the pdf file without bookmarks first. After that one could include the generated pdf file in a new LaTeX document and than use the bookmark package with explicit page numbers. This method is also shown on this page. % Taken from http://michaelgoerz.net/notes/pdf-bookmarks-with-latex.html \documentclass{article} ...


4

The \hyper@normalise function applied by \href does not take into account that : might have a different category code. \documentclass{article} \usepackage{expl3} \usepackage{hyperref} \begingroup \makeatletter \endlinechar=-1 % \catcode`\^^A=14 % \catcode`\^^M\active \catcode`\%\active \catcode`\#\active \catcode`\_\active ...


3

You shouldn't redefine \descriptionlabel. That is used to format the label, and the argument can contains fonts, penalties and other things not really suitable in a label. Better use the format key of enumitem: \documentclass[12pt]{article} \usepackage{lingmacros, amssymb, setspace, units, tabto, array, hyperref, nameref, enumitem, footnote, cite, changes, ...


3

The reason for the extra space is the argument for \descriptionlabel The command \enit@description@i calls \descriptionlabel and applies \enit@align{\enit@format{##1}} effectively. This will lead to extra space since NSC\label{NSC} will add this space for \label{NSC}. I've applied another strategy: The argument of \item [Foo] will automatically generate ...


1

Another possibility: Use \renewcommand{\theHchapter}{otherchapter\thechapter} to prevent the doubled chapter counter values which confuses hyperref, because this sets the link anchors. \documentclass{report} \setlength\parindent{0em} \usepackage{hyperref} \begin{document} Reference to chapter 1: \ref{chapter_1} Reference to chapter A: \ref{chapter_a} ...


1

Just add option \usepackage[hypertexnames=false]{hyperref} \documentclass{report} \setlength\parindent{0pt} \usepackage[hypertexnames=false]{hyperref} \begin{document} Reference to chapter 1: \ref{chapter_1} Reference to chapter A: \ref{chapter_a} \chapter{A chapter} \label{chapter_1} \setcounter{chapter}{0} \renewcommand{\thechapter}{\Alph{chapter}}% ...


0

Resetting table or whatever counter especially in a unnumbered section must confuse hyperref, since this package creates 'unique' label names from section etc. counter values by applying the command \theHtable, for example. Now, since the table counter has the value 1 twice and no other unique value (like a section counter value) is available, the same ...


5

Load inputenc before titling, to make it aware about the unicode settings etc, otherwise it uses the wrong encoding for \author{äää} etc. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{titling} \author{äää} \date{\today} \title{üüüü} \RequirePackage[pdfencoding=unicode, psdextra]{hyperref} \AtBeginDocument{ \hypersetup{ ...


2

I recently ran into a similar issue where my section title was being split across two lines, but only one or two words were ending up on the second line. I wanted to manually insert a line break so that I could balance it better. I ended up using non-breaking spaces to force the line break to happen earlier instead: \section{this is a very long title I ...


4

The following code automatically generates a toc-map for all sections. Subsections are currently not supported. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{mindmap,trees,shadows} \usepackage{etoolbox} \usepackage{totcount} \newcounter{totalsection} \regtotcounter{totalsection} \setbeamertemplate{section in ...


0

Ok, I've solved the problem with ¿ and ¡ using LuateX and fonts as Mathpazo and Helvet. The solution is very easy: For ¿ symbol: \textquestiondown For ¡ symbol: \textexclamdown And that's all


0

After a lot of search, I finally found a simple solution: load hyperref before any ams package. Replacing the amsart document class by article class and pulling the hyperref package above the amsthm one solved my problem. For those who do want to use the amsart class that is still not a solution, though...


3

You have two types of theorems in your document -- numbered ones, of type plain, and unnumbered ones, of type named. As you've already discovered and pointed out, it's easy to assign a \label to a numbered theorem and to cross-reference it via \ref, \cref, or \aref. Theorems of the "named" type, in contrast, do not have a counter associated with them. ...


3

ÔÑã and ÔÇå are Unicode code points, viewed in mac roman encoding: ÔÑã: 0xEF, 0x84, 0x8B -> U+F10B ÔÇå: 0xEF, 0x82, 0x8C -> U+F08C The Unicode block is the private area. Font Awesome uses this area for its symbols: U+F10B: \faMobile or \faicon{mobile} U+F08C: \faLinkedinSquare or \faicon{linkedin-square} \documentclass{article} \usepackage{fontawesome} ...


2

If you insist you can make links local to both refesction and refsegment. \makeatletter \appto\blx@mkhyperref{% \let\blx@anchors\@empty \ifundef\hyper@natanchorstart {\protected\def\blx@anchor{% \xifinlist{\the\c@refsection @\the\c@refsegment @\abx@field@entrykey}{\blx@anchors} {} {\listxadd\blx@anchors{\the\c@refsection ...


1

Edited after edition of original post: First, some clarification regarding the use of refsegmentvs. refsection. Refsections are used if you want different bibliographies at different places of a larger work; e.g. at the end of each chapter. The labels generated are always local to the reflection. In contrast, refsegments are good for having one bibliography ...


0

This is almost the intended result of the refhcheck package. I say almost, for instead of {?} you should be seeing ?equ1? in its place, indicating the label for that equation. But the hyperref package messes that up for you. You can just do \usepackage[noref]{refcheck} or just live with this output, but remember to remove the refcheck package before ...


2

Here is a solution. The idea is to redefine \ttl@useclass to get informations about level of sectioning we are starting so that we can prepare the next navigationmenu and by the way display the navigationmenu of previews section just before starting the new one. \renewcommand*\ttl@useclass[2]{% ...


2

Package hyperref needs to be loaded before \newsubfloat. The macro calls \@addtoreset, which is supported and patched by hyperref to fix the anchor name issue. But if the macro is called before, then the original version of \@addtoreset is called without the patch, and the anchor names would have to be fixed manually. But this is not necessary with the right ...


3

You can use the usual label{…} inside a footnote and then refer back to the footnote with \ref{…}to print the number of the footnote. Together with the hyperrefpackage you can make the links clickable. The page number can be accessed using \pageref. This would be the most simple way of achieving the desired result, even though you have to type “Nota” and ...


1

You can use hyperref options, and locally modify it when needed. \documentclass{article} \usepackage[colorlinks=true,urlcolor=magenta]{hyperref} \newcommand{\myhref}[2] {\hypersetup{urlcolor=blue}% \href{#1}{#2}% \hypersetup{urlcolor=magenta}% } \begin{document} Here is \href{http://www.myurl.com}{my link}. ...


1

hypertexnames=false destroys the index feature here, because it removes the formatting of the page counter in the page anchor names.


0

Package ocgx2, v0.17 [2016/03/22], reimplements hyperref's ocgcolorlinks option, borrowing from diabonas' code. Moreover, it ports Layers and the ocgcolorlinks option to other engines where they haven't been available before. Thus, to have both, coloured links that print in the colour of the surrounding text and working PDF Layers, just say ...


4

Here is a suggestion using a KOMA-Script class together with package footnotebackref: \documentclass{scrartcl} \usepackage{footnotebackref} \deffootnote{1.5em}{1em}{% \textsuperscript{\hyperref[\BackrefFootnoteTag]{\thefootnotemark}}\,% } \usepackage{blindtext}% dummy text \begin{document} Something here\footnote{foo} \blindtext[2] And another footnote ...


0

Presently (april 2016) the links are shown in handouts: and they are somehow clickable. I usually put the links for my students on the bottom line of the slides. For some (to me) unknown reasons, when I hover in the empty area under the link, the mouse pointer change to a clickable item. And it actually opens the url. My files are compiled on Mint 17.2 ...


2

Here is a solution. The key point is \IfBeginWith command from xstring package It was hard to find the correct syntax for underlining using \pdfliteral but thanks to this tricks \documentclass{article} \usepackage{xcolor} \usepackage[colorlinks=false, pdfborderstyle={/S/U/W 1}, runbordercolor=red]{hyperref} \usepackage{xstring} \newlength\mtlength ...



Top 50 recent answers are included