Clash between Studia Logica class file and the hyperref package

I have to submit the final version of a paper to Studia Logica. This means that I need to use the Studia Logica's class file sl.cls as well as the packages slsec, stud_log, slfoot and slthm. All this files are provided by Studia Logica (I can't modify them) and are available here.

I would like to use the package hyperref, but it seems incompatible with Studia Logica class file. For a minimal example, if I try to compile

\documentclass{sl}     %% This the CLASS for Studia Logica,
%% similar to the 'article' class.

\usepackage{slsec}     %% PACKAGES for Studia Logica
\usepackage{stud_log}
\usepackage{slfoot}
\usepackage{slthm}     %% Theorem-like definitions as in amsthm,
%% see amsthdoc.tex (dvi) and thmtest.tex
%% for usage (see later for definitions)

\usepackage{hyperref}

\begin{document}
A word.
\end{document}


I get the three following errors:

Package atveryend Info: Empty hook BeforeClearDocument' on input line 15.

! Argument of \Hy@setref@link has an extra }.
<inserted text>
\par
l.15 \end{document}

I've run across a }' that doesn't seem to match anything.
For example, \def\a#1{...}' and \a}' would produce
this error. If you simply proceed now, the \par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your }' was spurious, just type 2' and it will go away.

Runaway argument?
{\@secondoffive }\fi --\pageref {SLLastPage}\hfill
! Paragraph ended before \Hy@setref@link was complete.
\par
l.15 \end{document}

I suspect you've forgotten a }', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! You can't use \raise' in internal vertical mode.
\@thefoot ...\pageref {SLLastPage}\hfill }{\raise
1.03pt\hbox {\tiny \copyri...
l.15 \end{document}

Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing I}' or I\$' or I\par'.


I can't believe that it is impossible to use hyperref, also because there are some papers freely available online that apparently use both Studia Logica class file and hyperref, see for instance here.

• Welcome to TeX.SX! – Bobyandbob Sep 19 '17 at 13:28
• Congrats on having your paper accepted ;-) Did you try to just ask them? There is a contact at editorialmanager.com/stud/default.aspx That's probably the simplest and most efficient way to know what to do: there could be hacks to make hyperref work with their class, but that can confuse them, and they will spend time undoing what you did! – Clément Oct 13 '17 at 17:25
• There are setting \label{SLFirstPage} too early (with \AtBeginDocument). If one remove this, it compiles. – Ulrike Fischer Oct 13 '17 at 17:27
• @Clément Errrm.. I guess, if they compile it for their journal, they will not have the modified classes. Or will you send the pdf to them? – basseur Oct 15 '17 at 21:20
• Someone should call them and ask to remove their faulty lines in their class file at their end. ;) – thymaro Oct 18 '17 at 5:51

The class file sets a \label{SLFirstPage} too early (with \AtBeginDocument).