Tag Info

New answers tagged

0

use colorlinks=false this =nocolor. colorlinks=true this=linkcolor here blue. for example \usepackage[colorlinks=false,linkcolor=bleu]{hyperref} nocolor and \usepackage[colorlinks=true,linkcolor=bleu]{hyperref} bleu


4

hyperref has the option ocgcolorlinks which does exactly what you want. From hyperref's README Experimental option ocgcolorlinks The idea are colored links, when viewed, but printed without colors. This new experimental option ocgcolorlinks uses Optional Content Groups, a feature introduced in PDF 1.5. The option must be given for ...


0

I use a compile-time switch. That is, I have this in my file header. \usepackage{etoolbox} % Are printing a hard copy or not? \newbool{hardcopybool} % set the default by uncommenting one or the other % \booltrue{hardcopybool} \boolfalse{hardcopybool} % the default % You can cause hyperlinks to be black by invoking with % pdflatex ...


3

Also LaTeX solutions are available. \include, \includeonly The document can be divided at page boundaries into single files, e.g. chapters. These are then included via \include. Then \includeonly with the file names, which should be included. Example: \documentclass{book} \usepackage{hyperref} \includeonly{Summary} \begin{document} ...


5

For a non-TeX solution: you can use the command line tool pdftk to splice up the original PDF and make a new PDF with just a subset of the pages from the original PDF. This will preserve the hyperlinks from the original PDF.


4

You can create a link to an embedded file using the JavaScript function exportDataObject. The following code creates a new command \embeddedfilelink{<file>}{<text>} that creates a link to an embedded file specified by its file name with the given link text. The code is taken from hypgotoe and modified to create a JavaScript action instead of a ...


1

Try this... not sure whether it may break other link anchors: \documentclass[twocolumn]{scrreprt} \usepackage{hyperref,lipsum,etoolbox} \makeatletter \def\tmphook{\setlength{\HyperRaiseLinkLength}{\glueexpr\scr@chapter@sectionafterskip+35pt\relax}} % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>} ...


2

You need to also adjust the H-style counter associated with thm: \documentclass{article} \usepackage{hyperref} \makeatletter \newenvironment{subtheorem}[1]{% \def\subtheoremcounter{#1}% \refstepcounter{#1}% \protected@edef\theparentnumber{\csname the#1\endcsname}% \setcounter{parentnumber}{\value{#1}}% \setcounter{#1}{0}% ...


1

As you are using hyperref I dont see the need for any additional package like bookmark For the numbering of regular section : hyperref as has an option bookmarksnumbered which does the job ! For the label of *-section : hyperref also defines a \phantomsectioncommand which creates the expected (unnumbered) bookmark, and which can be used for bookmarking the ...


0

You can use hyperref's \pdfstringdefDisableCommands: \documentclass{article} \usepackage{polyglossia} \setmainlanguage{english} \usepackage[backend=biber]{biblatex} \usepackage{hyperref} \usepackage[toc]{glossaries} \pdfstringdefDisableCommands{% \let\textenglish\@firstofone } \makeglossaries \newglossaryentry{foo}{ name=foo, description={is ...


3

You have somehow to mark the word you want to refer to: \documentclass{article} \usepackage[a6paper]{geometry} \usepackage[colorlinks]{hyperref} \makeatletter \newcommand{\setword}[2]{% \phantomsection #1\def\@currentlabel{\unexpanded{#1}}\label{#2}% } \makeatother \begin{document} Some text just to see where the link will point to Hi, I ...


0

\phantomsection should go to the correct page. If \clearpage only goes to the page before because of openright, then \cleardoublepage is the better choice: \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{\listfigurename} (\cleardoublepage can also be used, if twoside is not set, because then it behaves as \clearpage.)


3

It seems that the crucial difference is that in a current texlive bidi is Package: bidi 2015/02/17 yours is a year older. You should at least update bidi, it apparently has fixes to address this issue.


1

I simplified the usage by converting answer 1 into a LaTeX package. See romanbarpagenumber on CTAN. \usepackage{romanbarpagenumber} % And after \begin{document} \pagenumbering{Roman}


7

It is not hyperref that sanitizes the argument. The main difference between \section and your command is that the \addcontentsline is issued for the first in vertical mode. And the definition of the ! depends on the mode: \french@sh@!@ ->\ifhmode \ifdim \lastskip >\z@ \unskip \penalty \@M \FBthinspace \else \FDP@thinspace \fi \fi \string ! The ...


6

You can locally redefine \FBthinspace to do nothing. \newcommand{\mynaivesection}[1]{% \textbf{#1}% \begingroup% \renewcommand{\FBthinspace}{}% \addcontentsline{toc}{section}{#1}% \endgroup% } MWE: \documentclass[french]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage{hyperref} ...


3

This uses a 'hack' The label is stored using the \@currentlabel approach, which evaluates the current settings of the \the.... counter format output macro. I restored it temporarily, used \@currentchapterlabel, forced it to be \@currentlabel and added an automatic additional label prefixed with chapterfullabel::, which is written similarly, all in a ...


1

What about this, but you still have the problem of table of contents \documentclass[a4paper]{report} \usepackage{hyperref} \makeatletter \def\@seccntformat#1{\@ifundefined{#1@cntformat}% {\csname the#1\endcsname\quad}% {\csname #1@cntformat\endcsname}} \def\section@cntformat{\arabic{section}\quad} ...


3

I assume this doesn't happen often, otherwise you would have stuck with the default hierarchical definitions of sectional numbers, including chapters from the get-go. To that end, define a new \label macro, say \totallabel which prepends \thechapter. to the existing label that you can reference as usual using \ref: \documentclass[a4paper]{report} ...


1

\formlabel (i.e. \value{lexemeCounter}}) does not expand to something useful as a name for the \TextField command, so it's ignored and does show nothing. Using \number\value{lexemeCounter} however works. The value must be explicitly changed to a literal number representation for a string label (i.e. a text field name) \documentclass{scrartcl} ...


2

It's possible to set the link color inside of an environment temporarily to another value (other than specified before) and to restore it to the original one afterwards. I used the xpatch package to append the color change code after the start of the equation environment (macro \equation) and to switch back after \endequation (which is \end{equation} ...


1

The unicode equivalent of \mathbb{1} is the character 1D7D9, which has to be inserted into \texorpdfstring using \unicode{"1D7D9} \documentclass[12pt,titlepage]{article} \usepackage[utf8]{inputenc} \usepackage{bbm} \usepackage[pdfencoding=auto,unicode=true]{hyperref} \begin{document} \subsection{Model: Logistic Regression of ...


0

So, it really seems that the answer is no bibtex style with an easy implementation of the desired feature (or at least it is not easy with bibtex). Thanks to cfr I discovered biblatex/biber and the solution I like is http://tex.stackexchange.com/a/48409/66983 from question biblatex: make title hyperlink to DOIs, URL or ISBN. It has even more features than ...


5

In order to make hyperref work with endnotes, you could use enotez. All you have to do is load enotez instead of endnotes and use \printendnotes instead of \theendnotes: \documentclass{article} \usepackage{enotez} % <-- instead of \usepackage{endnotes} \usepackage{hyperref} \let\footnote=\endnote \begin{document} Sample text.\footnote{Sample ...


1

hyperref does a lot of 'severe' redefinitions of commands, so it's basically the package which has to be the last one (apart from some exceptions) in the preamble. Changing the order in which \usepackage{imakeidx} and \usepackage[...]{hyperref} are specified in the preamble works. \documentclass[11pt,a4paper,fleqn,pdftex]{report} ...


5

If you add \pdfcompresslevel=0 To the top of the document then you get filesizes of 3129555 and 13642 with and without hyperref. Looking in the pdf the first obvious difference is 26368 occurrences of the identical line /D [3 0 R /XYZ 88.291 795.961 null] which as far as I know is setting a named destination at those coordinates. That on its own ...


0

The problem has been solved. Own icons may be added to the package. I am not aware how to add the code without modifying the attachfile2.sty but the solution is enough for me. Best regards Peter


2

The simplest way to do this, that also happens to effect your choice of section numbering, is to add the section counter to those that are reset by \part. hyperref then automatically takes this into account when creating its anchors and links. The basic command to this is \@addtoreset{section}{part} As this command contains the @ character in its ...


3

The following redefinition of \JRNL helps track the existence of \REFDOI, and accordingly redefines \VOLUME to capture its argument(s) for placement in a hyperlink: \documentclass{article} \usepackage{hyperref,etoolbox} \hypersetup{colorlinks,% citecolor=white,% filecolor=blue,% linkcolor=blue,% urlcolor=blue, } \newcommand\JRNL[1]{% ...


2

I fixed the problem. It seems that it was a conflict between natbib and hypernat. I have just removed: \usepackage{hypernat}


2

This works: \documentclass[10pt,a4paper,colorlinks]{article} \usepackage[german]{babel} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{hyperref} \usepackage{tocloft} \usepackage{lipsum} \usepackage{etoolbox} \makeatletter \patchcmd{\ps@plain}{\thepage}{\hyperlink{contents}{\thepage}}{}{} \makeatother ...


2

biblatex's natbib-like commands \citepalias and \citetalias (whose definitions can be found in blx-natbib.def) can be turned into hyperlinked versions just as easily as the other commands \makeatletter \DeclareCiteCommand{\citetalias} {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \printtext[bibhyperref]{\@citealias{\thefield{entrykey}}}} ...


0

\REFDOI[https://www.google.com]{% \VOLUME{26}\SEP{, } \FPAGE{1177}\SEP{ (} \YEAR{1996}\SEP{). } } } with \newcommand\REFDOI[2][]{\href{#1}{#2}} works but where and when it may break depends on your luck. \documentclass{article} \usepackage{hyperref} \hypersetup{colorlinks,% citecolor=white,% filecolor=blue,% linkcolor=blue,% ...


3

You don't need a \bgroup in your definition since the change is local to the ToC. You should issue the following three commands to hide the colors in ToC, LoT and LoF: \addtocontents{toc}{\protect\hypersetup{hidelinks}} \addtocontents{lot}{\protect\hypersetup{hidelinks}} \addtocontents{lof}{\protect\hypersetup{hidelinks}} MWE: \documentclass{article} ...


3

Add \leavevmode before \hypertarget. The command \hypertarget eventually issues \nobreak and, if it's found after a blank line, this produces a penalty in vertical mode that inhibits page breaking.


4

You cannot use optional arguments for bookmarks, because LaTeX's implementation uses \futurelet, which is not expandable. Bookmarks strings are not typeset by TeX, only converted to a string. Since the macro with the optional argument does not have a following mandatory argument, there is no way detecting the optional argument using a macro-based approach. ...


4

The counter is ExNo, then the name for \autoref can be defined the following way: \newcommand*{\ExNoautorefname}{Example} \Next and friends call \printExNo to print the example number, thus it can be redefined to add the anchor (assuming default options of hyperref regarding links): \makeatletter \renewcommand{\printExNo}{% ...


4

The following example uses the zref referencing system. It defines a new property custom, which is set to the desired contents. \customlabel then stores the contents in the .aux file. \customref extracts the value in an expandable way, thus it can be used in \ifstrequals. An expandable version cannot make warnings, if the reference is undefined, thus this ...


1

With biblatex, we have to modify \blx@citation@entry, a command called for each citation item: \makeatletter \def\blx@citation@entry#1#2{% \blx@bibreq{#1}% \ifinlist{#1}{\blx@cites} {} {\listgadd{\blx@cites}{#1}% \blx@auxwrite\@mainaux{}{\string\abx@aux@cite{#1}}}% \ifinlistcs{#1}{blx@segm@\the\c@refsection @\the\c@refsegment} {} ...


4

Why not simply using the \ref-\label mechanism? \documentclass{article} \usepackage{hyperref} \makeatletter \newcommand{\customlabel}[2]{% \phantomsection \def\@currentlabel{\unexpanded{#2}}\label{#1}% } \makeatother \begin{document} \customlabel{refname}{som\'e text} \ref{refname} \end{document} The accent is just for showing that it doesn't make ...


2

Assuming that you're using e-TeX, you can tap into \pdfstrcmp for examining strings expandably: This is some regular text. The stored caption is some text. Do: that Do: this \documentclass{article} \newcommand{\customlabel}[1]{\expandafter\gdef\csname#1\endcsname} \newcommand{\getcaption}[1]{\expandafter\csname #1\endcsname} ...


1

The following seems to adhere to your requirements: \documentclass{book} \usepackage{chngcntr} \usepackage{bookmark}% Loads hyperref \hypersetup{colorlinks=true} \newcounter{exsec} \counterwithout{section}{chapter} \counterwithout{exsec}{chapter} \counterwithin{subsection}{exsec} \counterwithin*{exsec}{part} \renewcommand{\theexsec}{\Alph{exsec}} ...


3

Sure it is possible; you can use \hypersetup inside a group to locally change the color: \documentclass{article} \usepackage{xcolor} \usepackage{amsmath} \usepackage{hyperref} \begin{document} As we see, equation~{\hypersetup{linkbordercolor=cyan}\eqref{whatever}} is identical to equation~\eqref{whatever}. \begin{equation} \label{whatever} a=b. ...


0

The newtheorem did exactly what I needed. First I createt the theorem: \newtheorem{mydef}{Example}[section] Then my example would look like this \begin{mydef} \label{example:math} $Mathematical examlpe$ \end{mydef} In example \ref{example:math} we can find ...


0

Consider example as a theorem structure. You can easily do what you want with the ntheorem package: what you ask is the  break style in this package. I added the cleveref package for a more powerful management of cross references (if, for instance some of your examples later become remarks, you won't to go a-chasing all occurrences of the word ‘example’ to ...


2

Quick and dirty is to use \alert: \alert{Package pgf Error: No shape named is known} or to pass colorlinks option to \documentclass[a4paper,colorlinks]{beamer} %\documentclass[a4paper,colorlinks]{beamer} \documentclass[a4paper]{beamer} \usepackage{hyperref} \begin{document} \begin{frame}{tex.stackexchange.com} My first Question: ...


3

Not really an answer to your problem (which at least requires redefining \@part before loading hyperref; there's a much simpler way: redefine \l@part to ignore its second argument. \documentclass[11pt,fleqn]{book} \usepackage{etoolbox} \usepackage{hyperref} \makeatletter \patchcmd\l@part{#2}{}{}{} \makeatother \begin{document} \tableofcontents ...


1

\documentclass[11pt,fleqn]{book} \usepackage{hyperref} \makeatletter \def\addcontentslinepart#1#2#3{\addtocontents{#1}{\protect\contentsline{#2}{#3}{}{\@currentHref}}}% \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}% \addcontentslinepart{toc}{part}{\thepart\hspace{1em}#1}% \else ...



Top 50 recent answers are included