Tag Info

Hot answers tagged

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: ...


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 ...


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 ...


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.


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.) ...


5

Place a definitive marker - \phantomsection - after every \IEEEyesnumber in order to mark the appropriate hypertarget: \begin{IEEEeqnarray}{rCl}\IEEEyesnumber\phantomsection\label{eqn:FirstParentLabel} f(x) &=& 5x \IEEEyessubnumber\label{eqn:FirstSubeqnLabel} \end{IEEEeqnarray} ...


5

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.


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 ...


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 ...


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 ...


3

You have to set \@currentlabelname if you wish nameref to extract the appropriate content. Since you specify the question title using \questtitle, you could incorporate this addition using: \makeatletter \newcommand{\questtitle}[1]{% \renewcommand{\givenquesttitle}{#1}% \protected@edef\@currentlabelname{Quest~\givenquestid: #1}} \makeatother


3

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 ...


2

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}% ...


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} ...


2

Here’s one solution using the etoolbox and refcount packages: \documentclass{article} \usepackage{etoolbox} \usepackage{hyperref} \usepackage{refcount} \newcommand*{\myref}[1]{ \ifnumequal{\thepage}{\getpagerefnumber{#1}} {\ref*{#1}}{\ref{#1}} } \begin{document} \begin{figure} \caption{An empty figure} \label{fig:empty} \end{figure} This is a ...


2

The phenomenon you describe will be produced when using \setcounter{section}{0} to manually reset the counter. Here's a simple document reproducing the error: \documentclass{article} \usepackage[colorlinks]{hyperref} \begin{document} \tableofcontents \part{Test part one} \setcounter{section}{0} \clearpage \section{First test section in part one} ...


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 ...


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 ...


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 ...


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} ...


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} ...


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}


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} ...


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 ...


1

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}% <----- ...


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 = ...



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