0

I have a strange problem, where using a tag with an equation creates a warning (that obviously later leads to some unwanted behavior, though not in the context of this question)

I use to import two files, containing equations

main.text content:

\documentclass{article}

\usepackage{amsmath} \usepackage{standalone} \usepackage{import}

\usepackage{hyperref} \usepackage{cleveref}

\begin{document} \import{.}{first} \import{.}{second} \end{document}

first.tex content:

\documentclass{article}

\usepackage{amsmath} \usepackage{import}

\begin{document} \begin{equation}
B > A\tag{$B_2$}% \label{eq:B_2} \end{equation} \end{document}

second.tex context:

\documentclass{article}

\usepackage{amsmath} \usepackage{import}

\begin{document} \begin{equation}
A = B \label{eq:C_1} \end{equation} \end{document}

The warning looks like

pdfTeX warning (ext4): destination with the same identifier (name{equation.0.1} ) has been already used, duplicate ignored ...shipout:D \box_use:N \l_shipout_box _shipout_drop_firstpage... l.13 \end{document}

It appears in connection with using \tag, hyperref and cleveref. Dropping any one of the three removes the problem.

I'm at;

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.3) (preloaded format=pdflatex 2022.3.16)

Not really sure, but I think the problem was non-existent on 10/2021.

What is the problem? And how should I address it?

dEmigOd
  • 397
  • Probably a duplicate of https://tex.stackexchange.com/questions/488299/hyperrefs-hyperlinks-getting-offset-by-custom-tags – dEmigOd May 12 '22 at 07:16
  • or even https://tex.stackexchange.com/questions/54728/hyperref-jumps-to-the-wrong-equation-if-the-equation-has-a-tag-and-cleveref-is (this one have a simple solution to use starred-equation environment) – dEmigOd May 12 '22 at 07:24
  • a starred equation would avoid the problem but would also not create a destination so you couldn't link to it. I would use Marijn's solution and prepend a counter. – Ulrike Fischer May 12 '22 at 08:32
  • @UlrikeFischer, I have a link in my document (it is though few lines apart from the equation), and it seems to take control to the equation. Which link do you refer to? – dEmigOd May 12 '22 at 08:39
  • sorry I meant you don't get a target if you used a starred equation without tag. – Ulrike Fischer May 12 '22 at 10:23

0 Answers0