Edit: The class smfart is one of several classes created by the Société Mathématique de France for typesetting mathematics. Here is its CTAN page, where it lies under smflatex, and here is the documentation.

Briefly put, the class smfart, when combined with hyperref, does not properly link to the theorem environment.

Here is a minimal working example:

\documentclass[english]{smfart}
\usepackage[francais,english]{babel}
\usepackage{smfthm}
\usepackage{hyperref}

\begin{document}
\mainmatter

\begin{theo}\label{thetheorem}
d
\end{theo}

Consider \ref{thetheorem}

\end{document}


I compile by running pdflatex on the file twice. The second time, you get the following error message:

pdfTeX warning (dest): name{smfthm.0.1} ha
s been referenced but does not exist, replaced by a fixed one


It is not difficult to check that the hyperlink which should link to the theorem actually links to the very beginning of the document.

What is going on here? Is there a known way to fix this?

• Since smfart is not a known class, it might be an idea to provide a link to where one can get this (it is not listed on CTAN). Jun 11 '14 at 15:19
• The problem seems to lie in the fact that smfart loads amsthm but also modifies the meaning of several commands of this package, while hyperref works under the assumption that these commands are not redefined. Jun 11 '14 at 16:20

The smfart class changes the definitions related to new theorems, after loading amsthm, in particular \@begintheorem.

Now hyperref sees that amsthm is loaded and so hooks in \@begintheorem expecting it to be the same as provided by the package, but it is not. Conflict ensues.

Since smfart and the other similar classes are not on CTAN it is very unlikely that Heiko Oberdiek takes action for coping with it. This is a job for the developers of the class, if they want to support hyperref in their documents.

• Hi, do you know if there is some "hack" we can use to fix this problem while we wait for the class developers to solve the issue?
– vap
Apr 8 '18 at 19:48
• @vap Sorry, no. Apr 8 '18 at 20:18

Inserting a \phantomsection before \label{bla} fixes this issue. See also here.

Inspired by the observation of egreg, I've compared the files smfart.cls and amsthm.sty. It seems that there are two crucial lines in the amsth.sty version of \@begintheorem which are missing in the smfart.cls version, namely

\global\@inlabeltrue
\everypar\dth@everypar


Adding these two lines into the definition of \@begintheorem in smfart.cls seems to resolve the problem. Here is an example of modification:

\def\@begintheorem#1#2[#3]{%
\@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
\@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
\@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
\ifdim\wd\@tempboxa>0.7\linewidth \smf@skippttrue\fi
\ifsmf@skippt
\global\smf@skipptfalse
\item [\thm@indent]%
\nobreak\everypar{}%