I've tried to make bilingual caption with package "ccaption" and compiled it with pdfLaTeX.
It works fine but with a warning:
pdfTeX warning (ext4): destination with the same identifier (name{figure.1}) has been already used, duplicate ignored.
Here is a mini example:
\documentclass[UTF8]{ctexart}
\usepackage{graphicx}
\usepackage{ccaption}
\usepackage{hyperref}
\begin{document}
Figure \ref{fig1}
\begin{figure}
\bicaption[fig1]{}{中文标题}{Fig.}{English caption}
\end{figure}
\end{document}
Sorry for the inconvenience if you don't have package ctex which defines a documents class ctexart for typesetting Chinese. You can replace the documentclass
with article
and the warning it still there.
Best Answer
ccaption
uses an elementary (and mostly feasible) way of producing duplicate captions for the same float. The main function at play here is\contcaption
:It steps the regular float counter back by one, sets a reference and then continues a call to set the actual caption text. On the
.aux
-file side, this leads to two cross-reference entries with the same hyperlink anchor name... something thathyperref
doesn't enjoy. True, withouthyperref
, this problem won't be noticeable.A way around this is to use an alias counter, provided by the
aliascnt
package, and using it as part of\contcaption
:The above MWE provides the alias
figurealt
which should work in tandem withfigure
, using it as the replacement reference for the second (continued) caption rather than the traditional float counter.A similar alias can be created for other floats (like
table
, usingtablealt
).