Tag Info

New answers tagged

1

There's an unprotected end-of-line: \newcommand{\determineSection}{% <----- THIS ONE \ifnum\value{subsection} > 0 \ifnum\value{subsubsection} > 0 \ifnum\value{paragraph} > 0 \ifnum\value{subparagraph} > 0 \thesubparagraph \else \theparagraph \fi \else ...


0

I have the same issue using Evince to show pdf files. The following works for me: \usepackage{hyperref} \hypersetup{ pdfpagelayout=OneColumn, pdfview=Fit, pdfstartview=Fit } I hope helps.


1

Rather than manually numbering the environments, you should simply change the related counter's representation: \documentclass{article} \usepackage{amsthm} \newtheorem{hyp}{Hyp} \renewcommand{\thehyp}{\Alph{hyp}} \begin{document} \begin{hyp}\label{hyp-flat} The Earth is flat. \end{hyp} Assuming Hyp~\ref{hyp-flat} we now prove that pigs can fly. ...


6

Even if the urls are turned off at TOC, they may appear in other places like the headers. Hence it is better to use the optional argument of \section \documentclass{article} \usepackage[% unicode, colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue]% {hyperref} \begin{document} \tableofcontents ...


5

\href can be redefined locally: \begingroup \renewcommand*{\href}[2]{#2} \tableofcontents \endgroup


1

Line breaks are a very delicate, fragile and complex matter. If you have problems with your line breaking I would suggest trying the following solutions in the order listed here. The package microtype can often help with line breaks and other micro-typographic features. It cannot help with all problems, the issue in the MWE it is well able to resolve. ...


5

moderncv loads hyperref package by itself with the option unicode. These are the lines from moderncv.cls. \AtEndPreamble{ \pagenumbering{arabic}% has to be issued before loading hyperref, as to set \thepage and hence to avoid hyperref issuing a warning and setting pdfpagelabels=false \RequirePackage[unicode]{hyperref}% unicode is required for unicode ...


4

You are leaving end of line spaces. Put % at the end at two places like \newcommand\Myhref[2]{%<-------- here \href{#1}{#2}% <-------- and here } Then you are good to go. \documentclass{article} \usepackage{hyperref} \newcommand\Myhref[2]{%<-------- here \href{#1}{#2}% %<-------- and here } \begin{document} A link is placed ...


1

If you're always including a \TOCpart immediately before a \chapter (with no content discussion), you can use "page + 1" as the page for the \TOCpart. Additionally, as hyperlink jump, you can use whatever will be set by the subsequent \chapter. It has the form chapter.#. The above is implemented below: \begin{filecontents}{chap1.tex} \chapter{Chapter} ...


3

if an \addcontentsline is in the "main" file, just before an \include, it is deferred. the \addcontents (and therefore the \TOCpart here) needs to go inside that \included file, even though that seems counter-intuitive, and obscures the fact that you needed to accomplish the change that way. i recommend leaving a comment in the main file to say what you've ...


2

If you look at the aux file you will see that \@input{chap2.aux} occurs before \@writefile{toc}{\contentsline {part}{\numberline {II}TOC Part}{7}{part.2}} and there is nothing one can do about it. I even tried modifying \@docinclude to not use \immediate\write\@mainaux{\string\@input{#1.aux}}. Anyway, the main key is to use \input instead of \include. The ...


3

beamer already loads hyperref internally, so you attempt produces a clash. You can pass the options to the class using the hyperref key (there are also pgf, color and xcolor keys to pass options to the corresponding packages): \documentclass[ xcolor={svgnames}, hyperref={colorlinks,citecolor=DeepPink4,linkcolor=DarkRed,urlcolor=DarkBlue} ]{beamer} ...


4

As mentioned by egreg, it's easy using cleveref (which must be loaded after hyperref). Simply define \crefformat{equation}{#2equation~#1#3} \Crefformat{equation}{#2Equation~#1#3} The arguments #2 and #3 are used to mark the beginning and end of the part of the cross-reference that forms the hyperlink when the hyperref package is used. Then simply use ...


4

As Egreg mentions, you can use cleverref, if you do not want to you can use something similar to this.We use the fact that \ref* (aka non-link ref) in hyperref is the macro \@refstar. Thus inside the new \eqref we make the link via \hyperref[target]{text} and make sure that text itself, does not contain any hyperrefs (as nested hyperlinks does not really ...


5

The problem is not directly related to hyperref; the root cause is that you are trying to skip the picture while it is being generated. This results in a 0-size pdf, and that is deleted right-away by pdftex. This is what happens: the main program is typeset, and this is where your "if image exists" logic should apply. It does not since the graphics does ...


5

I cannot explain the error. Do not give me the bounty. (see next section) Assuming your MWE, \scalebox works. Let me know if you intend to achieve something more complicated. By the way, whatever your goal is, the logic is that external is superior to \IfFileExists. \documentclass{article} \usepackage[usenames,dvipsnames]{xcolor} ...


2

This is a classic '\edef (or similar) applied to fragile user input' issue: there's an \xdef in \svn@pushfilestack which fails if you have an 'unsafe' token inside any of the parts it's trying to apply that to. As with any LaTeX2e user input, the correct approach is to use the LaTeX kernel \protected@... equivalent \documentclass[a4paper]{memoir} ...


2

Once you load the xcolor package, you have access to all the color specifications this package allows; in particular, you can use the hundredths of predefined colors it provides, to the ! modifier for mixing colors, to the - for complements, etc.; using \definecolor{<name>}{<model>}{<specification>} you can build your own colors in the ...


3

The class does \AtBeginDocument{\@ifpackageloaded{hyperref} {\def\@linkcolor{blue} \def\@anchorcolor{blue} \def\@citecolor{blue} \def\@filecolor{blue} \def\@urlcolor{blue} \def\@menucolor{blue} \def\@pagecolor{blue} \begingroup \@makeother\`% \@makeother\=% \edef\x{% \edef\noexpand\x{% \endgroup \noexpand\toks@{% ...


5

pdftex is warning you in the log that the destination anchors are not unique l.43 \caption{Tab two} pdfTeX warning (ext4): destination with the same identifier (name{table.1}) has been already used, duplicate ignored <to be read again> As Heiko wrote in this case the easiest is to move the \numberwithin ...


8

hyperref supports \numberwithin, but only if it awares of it. Therefore, \numberwithin should be used after package hyperref. Further remarks: Option allcolors simplifies the setting of the colors to one color with option colorlinks. Package hyperref detects driver pdftex automatically, it does not need to be set explicitly. KOMAScript option ...


0

The hyperref manual states in Section 8: Packages that typeset the contents of the \label and \ref macros, such as showkeys. Since the hyperref package redefines these commands, you must set implicit=false for these packages to work. Your example appears to work for me if the document starts as follows: \documentclass{article} ...


3

As percusse mentions in his comment, \only<> will delay the border created by hyperref: \documentclass{beamer} \setbeamertemplate{navigation symbols}{} \hypersetup{colorlinks = false, urlbordercolor = 0 1 0, pdfborder = 0 0 .5} \begin{document} \begin{frame} \begin{itemize} \item A link will appear below: \only<2->{\item ...


3

The character # in the link defined in the caption needs to be escaped with a double backslash. Try this: \documentclass{article} \usepackage{hyperref} \begin{document} <<TestPlot, fig.cap="\\href{http://amor.cms.hu-berlin.de/~schulzgu/gentri/\\#mieteaenderung}{If you escape the character \\# in the link with a double backslash, then everything is ...


0

I got this problem when using apacite package and hyperref package simultaneously. With the error message ! Undefined control sequence. \hyper@@link ->\let \Hy@reserved@a \relax \@ifnextchar [{\hyper@link@ }{\hyp... l.65 ...d graph partitioning problems \cite{xxxx} It turned out that I had put ...


3

\underline does not allow line breaks. Package ulem The text must not hidden in a macro or in curly braces. \documentclass[10pt,a4paper]{article} \usepackage{hyperref} \usepackage{lmodern} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[normalem]{ulem} \newcommand\lipsumi{Lorem ipsum dolor sit amet, consectetuer adipiscing ...


0

Try using the url or breakurl packages. As documentation for url says: The com­mand \url is a form of ver­ba­tim com­mand that al­lows line­breaks at cer­tain char­ac­ters or com­bi­na­tions of char­ac­ters, ac­cepts re­con­fig­u­ra­tion, and can usu­ally be used in the ar­gu­ment to an­other com­mand. (The \urldef com­mand pro­vides ro­bust com­mands ...


1

Option -z of dvips is for the hypertex drivers, which is based on DVI hyperTeX specials: \usepackage[hypertex]{hyperref} When option dvips is used: \usepackage[dvips]{hyperref} then the driver based on pdfmarks is used. Then option -z should not be used. The way via pdfmark is more powerful, because more features are supported and the links can be ...


2

Package regexpatch can be used to replace a string inside the definition text of a macro multiple times: \documentclass{article} \usepackage{hyperref} \usepackage{regexpatch} \newcommand*{\doi}[1]{% \def\tmpdoi{#1}% \xpatchcmd*\tmpdoi{{\textunderscore}}{_}{}{}% \href{http://dx.doi.org/\tmpdoi}{doi:#1}% } \begin{document} DOI is clickable: ...


2

The border can be enabled by option pdfborder. The third number is the border thickness. Since the navigation elements should probably not have borders, the example sets the border in the frame only: \documentclass{beamer} \hypersetup{ urlbordercolor = {0 1 0}, } \begin{document} \makeatletter \begin{frame} \hypersetup{pdfborder={0 0 1}} ...


2

The following issues deal with hyperref: In \protect{CHAPTER } only the open curly brace { is protected, because \protect only acts on the next token (not a group of tokens). Anyway, the ugly prefix CHAPTER wastes valuable space in the bookmarks, thus I had changed it to \texorpdfstring{CHAPTER }{}. \MakeUppercase does not work in bookmarks, replaced by ...


5

An empty value disables the color, the example of egreg, simplified without the need for xcolor and without explicit color settings for links: \documentclass{article} \usepackage{color} \usepackage[colorlinks,linkcolor={}]{hyperref} \begin{document} \section{Section title}\label{test} This is an autoref to \autoref{test} \textcolor{red}{This is an ...


4

With xcolor you can refer to the current color with . \documentclass{article} \usepackage{xcolor} \usepackage[colorlinks,linkcolor=.]{hyperref} \begin{document} \section{Section title}\label{test} This is an autoref to \autoref{test} \textcolor{red}{This is an autoref to \autoref{test}} \end{document}


4

The unexpandable stuff (\lowercase, \textsc, \MakeLowercase) must not appear in any counter value, which is used in anchor names. Package hyperref already uses \theH<counter> instead of \the<counter>. But it fails for \theHstnumber, because it uses \thelstlisting instead of \theHlstlisting. Fix: \documentclass[english]{report} ...


3

Here is one option: A redefinition of \thelstlisting and \thetable (and others...) to {\scshape\alph{chapter}}.\arabic{<cntr>} when you reach \appendix: \documentclass{report} \usepackage[colorlinks=true]{hyperref} \usepackage{listings} \lstset{frame=single} \renewcommand{\thetable}{{\scshape\thechapter}.\arabic{table}} \AtBeginDocument{% ...


3

\url comes from package url (loaded by hyperref). \urlstyle configures the font. The same font: \urlstyle{same} This means, no special font is set and the current font is used for the URL. Other pre-defined styles: \urlstyle{rm}: The font \rmfamily is used. \urlstyle{sf}: The font \sffamily is used. \urlstyle{tt}: This is the default: \ttfamily. See ...


3

This was done on a smaller scale for a map of Hawaii using a 20x20 grid. For the final version you set the opacity of the map to 1. I find using a checkerboard background helps when aligning links to the map. Using a \parbox instead of tikz \matrix is much faster. I stole the map from http://www.enchantedlearning.com/usa/states/hawaii/map.GIF and ...


1

You have to issue \pagestyle{empty} for the duration of the front matter and then restore the default \pagestyle{plain}. I recommend stating also a different page numbering scheme for keeping hyperref happy and make the right links. Also I recommend the titles option to tocloft. In the following example I removed almost all the unnecessary packages (also ...


0

The answer from the post Is it possible to have back references after each chapter with a single main.bib file? solved my problem. It shows how to use packages natbib, chapterbib, hyperref, and backref to back reference the pages where citations appeared. Also, the commands should be pdflatex Sample.tex bibtex chp01 bibtex chp02 [...] pdflatex Sample.tex ...


6

It is possible to postprocess the html files using make4ht filters. We can find corresponding id attributes for labels in the aux file: \newlabel{invisible_figure}{{\rEfLiNK{x5-40011}{\csname :autoref\endcsname{figure}1}}{\rEfLiNK{x5-40011}{\csname :autoref\endcsname{figure}9}}{\rEfLiNK{x5-40011}{\csname :autoref\endcsname{figure}My invisible ...


2

This creates an invisible link box in the center of the frame. You can tell where it is when the cursor changes. (Not on the image here, which is only a .png copy.) \documentclass{beamer} \usepackage{hyperref} \makeatletter \setbeamertemplate{background}{% ...


0

Package hyperref needs unique anchor names. Since counters sometimes do not have unique names, it introduces a companion "counter" form as \theH<counter>. Then \the<counter> do not be to be unique, but \theH<counter> must. The example redefines \thetable, but \theHtable is not changed. After making \theHtable unique again, the error is ...


3

If you put the following lines \showboxbreadth = 1000 % more than necessary \showboxdepth = 10 % much more than necessary \showlists after, say, the second occurence of \begin{example}This is an example. \end{example} TeX will write in the transcript file a description of the vertical list it is building. Looking at the beginning of this description, ...


2

Try using the following definition for your example: \newenvironment{example}{% \par \stepcounter{TotalCounter}% \hypertarget{exampleRef\theTotalCounter}{}% \textbf{Example \theTotalCounter.} }{\par\penalty0} It inserts a "\paragraph break" at the start and end of the environment, but also sets the \penalty for breaking across the page (at the end ...


3

The \autoref command can't 'know' the ref name for each counter, this has to be provided as a separate macro: I used the listings example by Marco Daniel provided in the Link by the O.P. and found that listings uses lstnumber as counter, so \newcommand{\lstnumberautorefname}{Line} is the relevant macro name to be defined (i.e. counter name + autorefname ...


4

It is not possible in general. TeX does not provide such kind of access. Also this will not work for expandable macros. A definition of a macro, which contains the argument would destroy the expandability, because a definition is not expandable. In this case, \hyperref is not expandable anyway, thus the latter argument does not apply. The label form with ...


5

First of all, load babel before appendix and glossaries, so, at least the latter, knows the language you are in. Also load fontenc with T1 option. Then add the following lines to your preamble \makeatletter \appto{\appendices}{\def\Hy@chapapp{Appendix}} \makeatother to get rid of all those errors (hyperref's \BOOKMARKs don't like names with accented ...


5

Package bookmark also supports URI actions in bookmarks, which can be used to link to other files or URLs. \documentclass{article} \usepackage{hyperref} \usepackage{bookmark} \bookmarksetup{open,numbered} \begin{document} \section{Hello World} \bookmark[ level=subsection, uri={http://tex.stackexchange.com/}, ]{URI: TeX.SX} \end{document} However, it ...


4

Try to move your redefinition after preamble, lot of stuff is done after preamble in tex4ht: \documentclass[a4paper,11pt]{book} \usepackage{hyperref} \begin{document} \renewcommand{\sectionautorefname}[1]{my section~} \section{hello}\label{sec:hello} Test \autoref{sec:hello} \end{document}


2

I've used \ifcsdef which tests if a command is already defined (without \). If it's defined then use \renewcommand else \newcommand or \providecommand. \documentclass[a4paper,11pt]{book} \usepackage{etoolbox} \usepackage{hyperref} \ifcsdef{sectionautorefname}{% \renewcommand{\sectionautorefname}[1]{Section~} }{% ...



Top 50 recent answers are included