Tag Info

New answers tagged

1

colorlinks cannot be enabled, after hyperref is loaded. Set the option as package option: \usepackage[colorlinks]{hyperref} The color Violet is undefined, this can be fixed, for example, by setting option svgnames for package xcolor. As Augustin has already analyzed in his answer, class elsarticle defines the colors of all link types to blue. This is done ...


1

The problem is caused by the elsarticle class which defines the colour of the links and prevents you from redefining them. If you change the style to article everything will work.


6

The problem is in the way that you redefine \@chapter, which is incompatible with hyperref. You can see this immediately if you comment out the line loading hyperref, just before \begin{document}. The hyperref package plays a lot with everything containing references; lines in the table of contents are just one such thing. It achieves this by redefining ...


4

The relevant command is from bookmark package, called \bookmarksetup -- since the appendix chapters should be on the same level as the parts, it's necessary to restart the next bookmark level again, using \bookmarksetup{startatroot} The bookmark package extends the hyperref bookmarking facilities and it does the whole bookmarking in one run, not in at least ...


2

hyperref has a companion, bookmark, which disables hyperref's bookmarks and gives you some additional power. Include it and also include: \bookmarksetup{startatroot} just before your appendix. That will fix the issue.


1

This is described in the tex faq: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ltxcmds An expl3-variant to show the internal command (which ends with a space as David mentioned): \documentclass{article} \usepackage{hyperref,expl3} \begin{document} \ExplSyntaxOn\cs_show:c{autoref~}\ExplSyntaxOff \end{document}


4

That is the code for \autoref if you want to see the code for the internal command \autoref_ (with a space) then {\let\protect\show\autoref} works > \autoref =macro: ->\leavevmode \@ifstar {\HyRef@autoref \@gobbletwo }{\HyRef@autoref \hyper@@lin k }. \autoref ->\protect \autoref l.4 {\let\protect\show\autoref }


2

This should solve the issue. The _ will have the right category code when the .aux file is read at begin document. I believe the problem is in the fact that arguments are grabbed “too soon” when hyperref is loaded. \documentclass{article} \usepackage{hyperref} \makeatletter \AtBeginDocument{ \catcode`_=12 \begingroup\lccode`~=`_ ...


1

You can achieve this thanks to the \ref* command, which, according to hyperref's manual, create a reference with the correct number, but without link. I also enclosed a solution with autoref, which I recommend (it automatically "guess" the type of the reference you are making, e.g., Theorem, Lemma, Figure, Chapter, etc.). \documentclass{article} ...


2

\newcommand{\newref}[1]{\hyperref[{#1}]{\ref*{#1}\,\ding{230}}} \hyperref{<label>}{<free text>} creates a link similar to \ref{<label>} using the same label <label>, but the second argument takes a free text. The star form \ref* creates a reference without link. This avoids a nested link, the reference is already inside the link, ...


0

I do not understand why you use \phantom section. For just referencing lines I would be use a new counter and \refstepcounter macro: \documentclass{article} \usepackage{hyperref} \usepackage{lipsum} \newcounter{linenumber} \newcommand{\linelabel}[1]{\refstepcounter{linenumber}\label{#1}} \begin{document} Cross-references to line \ref{line:x} and ...


1

\raisebox helps. Or if pdfTeX is used as TeX compiler, then its feature \vadjust pre can be used to insert something right before the current line: \begin{tabular}{ll} \vadjust pre{\phantomsection}% \edef\@currentlabel{$x$}% \label{line:x}% Line $x$ & $\frac{1}{2}$ \\ \vadjust pre{\phantomsection}% \edef\@currentlabel{$y$}% \label{line:y}% ...


1

Let me answer my own question: Insert \hypertarget{A}{text} in your text. {A} is the label and {text} is the sentence where you want to come back from your table (I have applied it to my tables). Put \hyperlink{A}{(Go back to text)} between \begin{table} and \end{table}, right above \end{table}. Highlighted (Go back to text) is placed beneath the table. ...


4

The externalization process puts the pictures in a separate PDF file, which is then included as image. However annotations are usually lost, when a PDF page is included. There are only quite complicated workarounds, e.g., project pax, which uses a PDF library to extract the annotations from the PDF file to reinsert them later at TeX level. Or reference can ...


3

According to the PDF specification for PDF 1.7 (ISO 32000-1:2008), you are out of luck. The action dictionary for Launch actions defines the following keys for options: Win dictionary (Optional) A dictionary containing Windows-specific launch parameters (see Table 204). Mac (undefined) (Optional) Mac OS-specific launch parameters; not yet ...


2

You can fix the issue by also modifying the definition of \theHfigure, which hyperref uses for creating links. \documentclass[ reprint, superscriptaddress, amsmath,amssymb, aps ]{revtex4-1} \usepackage{graphicx} \usepackage[colorlinks=true,urlcolor=blue]{hyperref} \begin{document} Some text with a reference to the first figure in the main body ...


0

You can adjust the way \section works and make \section* act the same way \section does, only with some minor modifications: \documentclass{book} \usepackage{bookmark} \hypersetup{bookmarksnumbered=true} \usepackage{xparse} \makeatletter \renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\space}% Just for this example \let\oldsection\section ...


6

This is a typical error: Loading packages which uses counters and special reference formats after cleveref is wrong, since this package uses sophisticated macros in in the background, well, to do the clever reference ;-) cleveref should be the last package to be loaded, even after hyperref \documentclass{article} \usepackage{amsmath} ...


0

With the commands \href and \allowbreak I was able to get the desired output. Dotted line and line break. Unfortunately I have no idea how it would be possible to add the \allowbreaks automatically after every /. \documentclass{article} \usepackage[hidelinks]{hyperref} \usepackage{ulem} \makeatother \AtBeginDocument{ \let\oldurl=\url ...


0

The draft options of hyperref or package nohyperref also removes the specials for the hyper features as links and destinations. These specials can have influence on paragraph and page breaking. The following example disables most hyper features, when driver pdftex is used. Links and destinations removed by redefining the primitives of pdfTeX relying on the ...


0

I had a similar problem which was not caused by a change in line spacing. The hyperref package was changing the paper size from A4 format to US letter format, thus leading to a page 18mm less high and shifting some text to the next page. I fixed the problem by declaring the page size in the document class: \documentclass[a4paper]{letter} Another solution ...


1

Package hyperref already tries to filter out many commands, which have no meaning in bookmarks. Bookmark are simple text strings and the PDF viewers do not understand TeX markup. In this case I suspect that to comes from the TeX primitive \hbox which has to as keyword to specify the width of a box. \hbox is filtered out and if the width is a dimen register, ...


4

The mailto: prefix of the email URI is missing: \documentclass{article} \usepackage{hyperref} \newcommand*{\Authoremail}{author@example.org} \begin{document} \href{mailto:\Authoremail}{\Authoremail} or \href{mailto:\Authoremail}{\nolinkurl{\Authoremail}} \end{document}


0

This seems to be working \usepackage{pdfpages} \makeatletter \renewcommand{\AM@addtolist@hook}{\phantomsection} \makeatother both before and after loading hyperref I just looked into the code for addtolist in pdfpages


2

All of these packages are changes the way references are written in the .aux file. The correct load order is \usepackage{xr-hyper} \usepackage{hyperref} \usepackage{cleveref} but you need this in both the main and the external document. So external document main1.tex: \documentclass{article} \usepackage{xr-hyper} \usepackage{hyperref} ...


0

Finally solved it. The only changes is mathptmx to tgtermes. And, in hyperref option, disable breaklinks and set implicit=false. Therefore, in UMalChemThesis.cls: \RequirePackage{tgtermes} %\RequirePackage{mathptmx} \RequirePackage[implicit=false,pdfborder={0 0 0}]{hyperref} Thanks to Johannes_B


3

this adds the same prefix (eg main:) to cleverref's able type as used for the label so the refence is of type main:section rather than section and then you can use \Crefname{main:section}{\TR-section}{\TR-main-sections}% to specify the format for that type. \documentclass{article} \usepackage{cleveref} \usepackage{xr} \makeatletter ...


2

Is this what you want? \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{amssymb} \usepackage[usenames,dvipsnames]{xcolor} \newtheorem{theorem}{Theorem} \usepackage{varioref} \usepackage{hyperref} \usepackage[noabbrev,capitalise,nameinlink]{cleveref} ...


3

The listings package allows the inclusion (and syntactic highlighting) of code. The code either comes from a file, like \lstinputlisting[frame=single,language=C++,numbers=left]{myfile.cc} Here, decorated with a frame and line numbering. Or is directly written in the LaTeX source : \begin{lstlisting} cout << "hello, world" << ...


3

Regarding the second alternative, check out listings package.


11

This uses the attachfile2 package (the attached file is just the ordinary hello world example in C (ok, it's not Matlab ;-)) \documentclass{article} \usepackage[pdfversion=1.7]{hyperref} \usepackage{attachfile2} \begin{document} This is the famous Hello World example: \attachfile[color=0 1 0,description={The famous Hello World example}]{helloworld.c} ...


19

The PDF format includes file attachments, which means other files can be attached much like in emails. One package that can do this is the attachfile package. This package inserts a link to the attached file in the document text. My preferred package is navigator. Navigator simply attaches the file; nothing appears in the document. The file is accessed ...


3

The solution is to patch \@chapter command befor loading hyperref but you will need somme extra space in \l@chapter you can do like this \documentclass{book} \usepackage{etoolbox} \makeatletter \patchcmd{\@chapter}{\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}}{\addcontentsline{toc}{chapter}{\protect\numberline{\chaptername}#1}}{}{} ...


0

If you do not want backref returns you to the wrong page in the text, it should not have identical numbering systems. Thus since the beginning of document until the beginning of the use of Arabic numerals, you must use Roman numerals. %%%%%%%%%%%%%%%%%%%%%% Debut du doccument %%%%%% \begin{document} \thispagestyle{empty} \pagenumbering{roman} ...


4

This should serve as a starting point. \documentclass[ebook,oneside,openany,17pt]{memoir} \usepackage[margin=0.3in]{geometry} \usepackage[hidelinks]{hyperref} \usepackage{blindtext} %% for demo \setsecnumformat{} \pagestyle{empty} \makeatletter \let\ps@plain\ps@empty \makeatother \providecommand\chapfont{} \makechapterstyle{mychap}{ ...


0

The reason for seeing references only on a per-chapter basis is the following: you have not set a master document. In order to do so, open the main .tex file in Texmaker (the one with all the input/includes of all your chapters). Then select Options / Define Current Document as "Master Document".


0

Some drivers do not support links, which are broken across lines. Option breaklinks helps for a print version. The disadvantage is that it cannot enable broken link support magically. Therefore the link areas are quite wrong. For the table of contents the problem can be easily solved by using option linktocpage, which makes the page numbers instead of the ...


2

The definition of \@caption contains the third argument more than once, from package caption (\@caption will redefined to become \caption@@caption): \long\def\caption@@caption#1[#2]#3{% \ifcaption@star \else \caption@prepareanchor{#1}{#2}% \memcaptioninfo{#1}{\csname the#1\endcsname}{#2}{#3}% \@nameuse{nag@hascaptiontrue}% \fi \par ...


2

When hyperref is loaded, the command \@caption is redefined so that the third argument #3 appears three different places in the code rather than just once. It seems that you just need to replace the third occurrence which is #3\fi to get your desired effect. \documentclass{article} \usepackage{caption} \usepackage{etoolbox} \usepackage{xstring} ...


2

\documentclass{article} \usepackage{hyperref} \newcounter{exo} \makeatletter \newenvironment{exo}[1]% {\refstepcounter{exo}% \protected@edef\@currentlabelname{#1}% addition here \vspace{0.5cm}\noindent {\large\bfseries{Exercice \theexo~: #1} \par} {\par\vspace{0.5cm}}} \makeatother \begin{document} A small example \section{First degree} \begin{exo}{First ...


1

According to authors instructions for Lecture Notes in Computer Science, you must use \email{<email address>} within \institute{} and therefore you should not obtain the style that you are looking for(*). Compile llncs.doc (in spite of the extension, is really a LaTeX file) with pfdlatex to see the instructions for authors. This is a MWE extracted ...


1

If you add (or remove) hyperref it is often necessary to remove all aux and toc files so they may be rebuilt in an appropriate way.


3

This is not a complete answer, but small subtle things seem to happen/break. For example, let's say that you are creating a PDF document, but that you don't provide a Form environment at all. If you use Adobe Acrobat Reader DC (version 2015.007.20033) to read your generated document, then when you enter your first character the whole GUI freezes ...


3

The fix is obtained by removing the \\ from the line, following the \ref. As I commented, the use of \\ is specialized for things like tabular and should generally be avoided in normal text. See David's answer at When to use \par and when \\ for a better discussion. I don't know what hyperref did to actually make the code break by placing a \\ immediately ...


3

You can define your own bracket command (or redefine \mkbibbrackets): \makeatletter \newrobustcmd{\mkbibbracketscolor}[1]{% \begingroup% \blx@blxinit \blx@setsfcodes \color{CeruleanRef}\bibopenbracket#1\bibclosebracket% \endgroup} \makeatother \DeclareCiteCommand{\cite}[\mkbibbracketscolor] {\usebibmacro{cite:init}% \usebibmacro{prenote}} ...


2

Because we are not sure that the text pdfTeX warning (dest): name{undefined} has been referenced is unbroken to more lines, the usage of grep is more complicated. Maybe this checking can be implemented more simple at macro level. For example, when we are using plain TeX with OPmac then the code sould be: \input opmac \hyperlinks\Blue\Blue ...


4

Environment dmath of package breqn does not use \refstepcounter for the incrementation of the counter equation. Package hyperref hooks into \refstepcounter to add a hyper anchor as link target. Therefore your example uses the anchor before (figure.1) and you get the previous figure as link target. Workaround: The following example patches \eq@setnumber to ...


0

Remove hypertexnames=false or set it to true. hyperref's anchor names usually consists of the counter name and the counter value (like \the<counter>). But the latter can sometimes contain weird stuff or is not unique. Then \theH<counter> should be defined to contain the counter value part for the anchor names. hypertexnames=false is an emergency ...


-1

Try do add this \cleardoublepage before \phantomsection ect. EDIT You could obtain the same with a simple \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{\bibname} \nocite{*} is a macro for the biblatex package but your example (and maybe your work) uses the manual bibliography.


3

The macros \href and \url change the category code of % to get of its comment behavior: \url{http://es.wikipedia.org/wiki/Lept%C3%B3n} \href{http://es.wikipedia.org/wiki/Lept%C3%B3n}{Lept\'on} But inside the argument of another macro, this will not work, because then the percent is already read as comment char, before the inner \url or \href is executed. ...



Top 50 recent answers are included