1

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?

2
  • 1
    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).
    – daleif
    Jun 11 '14 at 15:19
  • 2
    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.
    – egreg
    Jun 11 '14 at 16:20
2

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.

2
  • 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.
    – egreg
    Apr 8 '18 at 20:18
0

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

0

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]{%
  \def\@theoremhead{\normalfont\the\thm@headfont
    \@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
    \@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
    \@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
  \thm@swap\swappedhead\thmhead{#1}{#2}{#3}}%
  \sbox\@tempboxa{\@theoremhead}%
  \ifdim\wd\@tempboxa>0.7\linewidth \smf@skippttrue\fi
  \ifsmf@skippt
  \global\smf@skipptfalse
  \item [\thm@indent]%
    {\sloppy\@theoremhead\parskip\z@\@@par}%
  \nobreak\everypar{}%
  \let\thmheadnl\relax
  \else
  \item[\hskip\labelsep\thm@indent\unhbox\@tempboxa\the\thm@headpunct]%
  %%    \hskip\z@\ignorespaces
  \fi
  \@restorelabelsep
  \thmheadnl % possibly a newline.
   \global\@inlabeltrue   %the two lines 
   \everypar\dth@everypar %borrowed from amsthm
  \ignorespaces}

I would be happy if anyone can kindly explain the meaning of these two lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.