Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlink to subequations wrong #8

Open
PlatinumMike opened this issue Feb 9, 2023 · 2 comments
Open

Hyperlink to subequations wrong #8

PlatinumMike opened this issue Feb 9, 2023 · 2 comments

Comments

@PlatinumMike
Copy link

This is a rather niche problem, but I ran into the following issue:

It occurs when clicking a hyperlink to a label inside align, inside subequations.
Example:

\begin{subequations}
	\label{subeq1}
	\begin{align}
		x=1 \label{subeq1a} \\
		y=0 \label{subeq1b}
	\end{align}
\end{subequations}

blabla, \eqref{subeq1b}.

The issue only appears when this subequations environment is not the first equation of the section.
Once clicking the hyperlink it sends you to the first equation of the section + some offset.
Which can be confirmed by opening the .aux file.

To fix this the load order should be modified:
hyperref has to be last, but bookmarks has to go after that, and doi as well.
This means that in settings_epfl_template.tex the lines with \usepackage{doi} and \usepackage{bookmark} have to moved, so the end of the file looks as follows:

...
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{gensymb} %for degree symbol

\usepackage{hyperref} %needs to be the last package to be loaded, except for bookmark, which needs to be even later.
\hypersetup{pdfborder={0 0 0},
	colorlinks=true,
	linkcolor=black,
	citecolor=black,
	urlcolor=black}
\usepackage{bookmark} %needs to be after hyperref
\usepackage{doi} %needs to be after hyperref


% Fix the problem with delimiter size caused by fourier and amsmath packages.
\makeatletter
\def\resetMathstrut@{%
  \setbox\z@\hbox{%
    \mathchardef\@tempa\mathcode`\(\relax
      \def\@tempb##1"##2##3{\the\textfont"##3\char"}%
      \expandafter\@tempb\meaning\@tempa \relax
  }%
  \ht\[email protected]\ht\z@ \dp\[email protected]\dp\z@
}
\makeatother
@lbelzile
Copy link
Contributor

Thanks for the report. It seems that bookmark is already loaded after hyperref in the template, whereas doi is commented out (I guess we could move it down). Note that multiple packages (e.g., cleveref) overwrite definitions from hyperref.

@lbelzile
Copy link
Contributor

The sty file for doi does load hyperref, so you could either load hyperref before or remove it altogether if you use doi. @glederrey except for moving doi down, this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants