Hot answers tagged

8

The change to hyperref was to fix this issue https://github.com/ho-tex/hyperref/issues/11 which I have just re-opened, pointing here. I will update hyperref to address this (somehow:-) but meanwhile, this works: \documentclass{article} \usepackage{amsthm} \usepackage{hyperref} \usepackage{cleveref} \newtheorem{thm}[equation]{Theorem} \makeatletter ...


4

Credits go to Christian Hupfer for solving the requests in his answer. I can add a shorter way to implement Christians solution: \documentclass{article} \usepackage{nameref} \usepackage{hyperref} \usepackage{tcolorbox} \tcbuselibrary{theorems} \makeatletter \newtcbtheorem{thm}{Theorem}{code={\edef\@currentlabelname{#2}}}{thm} %\newtcbtheorem{thm}{...


4

The reason is that \@currentlabelname is not defined which is written to the .aux by nameref's version of \label. The easiest way to solve this is either a patch or slight redefinition, setting \@currentlabelname with {##2}, which expands later on to contain the theorem name. (A patch would also do!) \documentclass{article} \usepackage{tcolorbox} \...


4

The warnings (not errors) come from the bookmark code. The setting of the space factor by \@ can be used with TeX, but not in bookmark strings. There the command can be disabled by: \usepackage{hyperref}% option "pdfencoding=auto" or "unicode" recommended \pdfstringdefDisableCommands{\let\@\@empty}


3

Not any character is possible in a PDF bookmark -- Unicode is supported but this requires a different setup of the content of bookmarks. This can be achieved with \texorpdfstring{TeX content}{pdf content} \documentclass{article} \usepackage{textgreek} \usepackage{hyperref} \hypersetup{pdftex,unicode,colorlinks=true,allcolors=black} \usepackage{hypcap} ...


3

Perhaps KOMA classes provide better ways, but \@currentlabelname has to be set (alternativle \NR@gettitle) to be effective with nameref, i.e. use the optional argument value #2 as content of \@currentlabelname! \documentclass{scrreprt} \usepackage{hyperref} \usepackage{cleveref} \usepackage{xparse} \makeatletter \let\latex@@section\section \...


2

The apacite manual clearly states on page 47, Section 8.2: The hyperref package turns (cross-) references into hypertext links. This can be used in conjunction with a program such as LATEX2HTML to compose .html les with clickable links, to internet pages or within the same document, or it can be used to create a .pdf document with clickable ...


2

With a KOMA-Script class you can use \addsec. Then it is possible to define a short title in the optional argument. \documentclass{scrreprt} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \tableofcontents \chapter{chapter} \section[short title 1]{Long Title Section One}\label{sec:One} In \cref{sec:One} (\nameref{sec:One}) I refer to \nameref{...


2

You can do this as follows -- \documentclass{article} \usepackage{hyperref} \usepackage{xcolor} \hypersetup{pdftitle={main.pdf}, colorlinks=false, linkbordercolor=red } \begin{document} \tableofcontents \section{test} \section{test2} This is testing hyperref \end{document} Here is the result - That's what you wanted. ...


1

Similar to Hendrik Vogt's answer, but using the expandable \getpagerefnumber from refcount (which is part of the hyperref bundle anyway!) (I used his example, however!) I've redefined \autoref to provide the feature instead of using a new macro name for this. \documentclass{article} \usepackage{xparse}% \usepackage{blindtext} \usepackage{letltxmacro} \...



Only top voted, non community-wiki answers of a minimum length are eligible