# Tag Info

5

Anchor for the index title that uses \twocolumn In the meanwhile the trouble (order of \phantomsection and \addcontentsline) with MWE is fixed and we can look at the real problem: \cleardoublepage \phantomsection \addcontentsline{toc}{chapter}{\indexname} suffers from a side effect of the optional argument of \twocolumn. The title in the optional ...

0

1

Workaround I am experiencing the same problem as the OP after zooming in a page and clicking the hyperlinks. I am using the \chapter* command to get a wanted effect (raising an anchor). % run: *latex mal-indextext.tex % plus makeindex, plus another LaTeX run \documentclass{book} \usepackage{hyperref} \usepackage{makeidx} \makeindex \begin{document} ...

4

As suspected by egreg the problem is caused by \@firstupper. If hyperref is loaded, the first token is \AC@hyperlink, but it should be applied to the string in the second argument of \AC@hyperlink. The following example patches \@Iac that contains the call of \@firstupper to propagate \@firstupper to the second argument of \AC@hyperlink if it is present. ...

2

I'm not sure it's a good thing to have the \label automatically prepared. Anyway, cleveref makes the thing you ask very simple. \documentclass{memoir} \usepackage{hyperref} \usepackage{cleveref} \newcounter{requirements} \setcounter{requirements}{0} \crefname{requirements}{Req.}{Req.} \newcommand{\Requirement}[1]{% \par\addvspace{\topsep}% <----- ...

2

I added the macro \Rqref{1} to provide Req. 1 (it is longer to type, but the OP asked for it, and it allows the OP to change the definition in one place to make all occurrences say "Requirement 1" instead of "Req. 1", for example). I also provide the macro \Rqtext{2} to provide the actual text of the requirement. \documentclass{memoir} ...

3

We usually redefine \the_counter_, please see an example. % run: *latex mal-req.tex \documentclass{memoir} \usepackage[colorlinks]{hyperref} \usepackage{lipsum} \newcounter{requirements} \setcounter{requirements}{0} \newcommand{\Requirement}[1]{% ~\linebreak\noindent% {\hspace*{1em}{% \refstepcounter{requirements}% ...

4

You need that LaTeX sees a “stringified” #; here's a way \documentclass{article} \usepackage{hyperref} \begingroup\lccode?=# \lowercase{\endgroup \newcommand{\myhref}[2]{\href{fileA.pdf?#1}{#2}} } \begin{document} \myhref{fileAhypertarget}{Let's go} \end{document} Of course you lose the special treatment \href does to special characters, but it's ...

0

If I understand your setup correctly, you have two separate standalone documents, say, doca.tex and docb.tex, and you'd like to cross-reference an item (e.g., a chapter) from Document A in Document B. One way to achieve this objective is to use the xr-hyper package, which is part of the hyperref bundle. The xr-hyper pacakge works exactly the xr package. ...

1

You could try the following. We will presume we have two .bib files: \jobname-1.bib and \jobname-2.bib, here created via filecontents* \begin{filecontents*}{\jobname-1.bib} @inproceedings{slam2001, author = {Thomas Ball and Sriram K. Rajamani}, title = {Automatically Validating Temporal Safety Properties of Interfaces}, booktitle = ...

6

hyperref introduces \theH<counter>. If it exists it is used for the destination name instead of \the<counter>. If the values of \the<counter> are not unique, define \theH<counter> with unique values using your other variables, e.g.: \renewcommand*{\theH<counter>}{<other variable>.\the<counter>} Pseudo code, the ...

4

\thecount needs to be expanded for \@currentlabelnmae. Otherwise the reference contains \thecount and the current number is print in the references. \edef\@currentlabelname{awesome: \thecount} or \protected@edef\@currentlabelname{awesome: \thecount} LaTeX's protection mechanisms (such as \protect) will work, if \protected@edef is used.

3


3

I am enclosing my patch. I am partly executing the draft option as defined in the hyperref.sty file from the hyperref bundle with two key lines commented out. %! *latex mal-hyperlinks.tex \documentclass{article} \pagestyle{empty} \usepackage[colorlinks]{hyperref} % Patch: draft option do all this: \makeatletter \let\hyper@@anchor\@gobble ...

2

The text in the bookmarks is not typeset: font changes are not possible and math formatting is impossible. So the best you can get is an approximate representation of the title. In this case I suggest \section{\texorpdfstring{$V^{\ast}$}{V*}} Minimal example with picture: \documentclass{article} \usepackage{hyperref} \begin{document} ...

2

With option unicode/pdfencoding=auto and psdextra, many math operators including \ast are available in bookmarks. (Option unicode is not related to the input encoding, but to the encoding of the bookmarks. Option pdfencoding=auto uses Unicode if needed, otherwise the 8-bit PdfDocEncoding is used.) \documentclass{article} ...

8

You can change the default format using \crefdefaultlabelformat; in your case, you can use \crefdefaultlabelformat{(#2#1#3)} A complete example: \documentclass{article} \usepackage{cleveref} \crefdefaultlabelformat{(#2#1#3)} \begin{document} \begin{table} \centering A \caption{a test table} \label{tab:test} \end{table} \begin{figure} \centering B ...

1

The linking via page numbers will not work properly, if hypertexnames is disabled. Therefore it should not set to false. The following example works for me: \documentclass{article} \usepackage[ pagebackref, hypertexnames, % default is true since a long time colorlinks, ]{hyperref} \renewcommand*{\backref}[1]{% \ifx\relax#1\empty \else (page ...

3

If we want sorting in index according to the Swedish sorting rules we usually pass -C utf8 -L swedish to xindy. The key problem I found is that we are not able to pass multiple nested parentheses on the input side, the output side, e.g. markup-locref, is having no difficulties. So the mentioned strategy is fine, to turn off generating of the second ...

1

Just use \clearpage rather than \cleardoublepage: \documentclass[twoside]{report} \usepackage{hyperref} \begin{document} \tableofcontents \clearpage \phantomsection \chapter*{Left side} \addcontentsline{toc}{chapter}{Left Side} \clearpage \phantomsection \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction} \end{document}

0

I am not sure if I should add this here, or as a comment to my question. I found a temporary solution for the problem. However, it is not a "technical" solution, as it does not explain why the problem exists in the first place. In order to get rid of the bookmark (which is not really there) I printed my pdf using "Adobe pdf". The new generated pdf file is ...

2

I also wanted to delete the annoying "xdvipdfmx (0.x.x)" and here is a solution for windows users (only TeX Live!): Be careful you have to patch the executable, do it on your own risk and make an backup of the file first. Get a Hex-Editor (I'm using the freeware CFF Explorer). Assuming your using it too, open the file xdvipdfmx.exe, go to "Hex Editor" and ...

10

Here is some hair pin curve. \path let \p1=(A.east), \p2=(B.west) , \n1={veclen(\x2-\x1,\y2-\y1)} in node[outer sep=0pt,inner xsep=0pt,align=left,anchor=west,minimum width=\n1,minimum height=1ex] at (A.east) (link) {\hyperlink{gotext}{\hphantom{\hspace*{\n1}}}}; Full code: ...

2

This effect isn't specific to glossaries but occurs more generally: \documentclass[a4paper]{report} \usepackage{fancyhdr} \usepackage{hyperref} \begin{document} \pagestyle{fancy} \chapter{Chapter} \section{Section} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent viverra eleifend mi, eget adipiscing velit. Aenean mauris diam, viverra ...

6

You can redefine \hypertarget so that it defines a new command corresponding to its first argument: \let\oldhypertarget\hypertarget \renewcommand{\hypertarget}[2]{% \oldhypertarget{#1}{#2}% \protected@write\@mainaux{}{% \string\expandafter\string\gdef \string\csname\string\detokenize{#1}\string\endcsname{#2}% }% } In this ...

1

Another alternative is to use the \cite* command which is provided by all by all author-year and author-title styles. See the manual, section 3.7.2 "Style-specific Commands".

4

The error appears when using scrreprt, because it defines % scrreprt.cls, line 2874: \newcommand\section{% \@startsection{section}{\sectionnumdepth}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% {\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax \setlength{\parfillskip}{\z@ plus 1fil}\fi ...

2

The LaTeX kernel already provides a mechanism for what you want: whenever \label is called, the current reference is made by expanding \p@foo\thefoo where foo is the most recently “refstepped” counter. Usually \p@foo (in your case \p@subsection) is defined to expand to nothing. So here's a minimal example for what you should do (I removed all the ...

5

for the reference counter of a theorem-class environment to be properly accessed by a \label, something has to follow the \begin{<environment>} in horizontal mode. since the next thing in this example is \begin{enumerate}, horizontal mode is never entered, and the label is lost. (i'm not sure exactly how it gets lost, but that's the net effect.) ...

1

Adding \leavevmode before the enumerate environment fixes the issue. \documentclass{amsart} \newtheorem{lem}{Lemma} \usepackage{hyperref} \begin{document} \section{test}\label{sec:1} See Lemma~\ref{testlemma} or rather Lemma~\ref{testlemma2} below. \begin{lem} \label{testlemma} \begin{enumerate} \item Testing! \end{enumerate} \end{lem} ...

6

The information entries are written when the first page is shipped out. The report class uses the titlepage environment in \maketitle, which puts the title on the page and starts a new page. The best is to set the entries earlier, e.g. in the preamble.

Top 50 recent answers are included