4

I have started to use suftesi for a book with multiple articles and tried with the minimal example from section 5:

\documentclass[structure=collection]{suftesi}
%process with pdflatex 

\begin{document}    
    \input{articleTest}
\end{document}

and a single article copied from the manual:

\begin{article}
\author{Author}
\title{Title of the paper}
% The abstract is optional.
% \begin{abstract}
% The abstract
% \end{abstract}
\maketitle
Text of the paper
\end{article}

This produces with pdflatex the error

Undefined control sequence. \maketitle

what must be changed?

4

It's not actually \maketitle that is undefined I think, your editor probably did a bad job parsing the error message. The complete error I get is

! Undefined control sequence.
\@maketitle ...{title.\thearticle }\Hy@raisedlink 
                                                  {\hyper@anchorstart {\@cur...
l.20 \maketitle

? 

The macro that caused the error is therefore \Hy@raisedlink (last macro before line break in error message), which is used in suftesis definition of \maketitle. That macro is defined by the hyperref package, so adding

\usepackage{hyperref}

solves the problem. (At least on my system.)

I added the missing \ before begin{article} by the way, I assume that was a copy-paste mistake.

\documentclass[structure=collection]{suftesi}
%process with pdflatex 
\usepackage{hyperref} % <-- add this

\begin{document}    
\begin{article}
\author{Author}
\title{Title of the paper}
% The abstract is optional.
% \begin{abstract}
% The abstract
% \end{abstract}
\maketitle
Text of the paper
\end{article}
\end{document}
  • thank you for the quick solution. It works - perhaps the suftesi package should indicate that hyperref is required. (I fixed the question for the missing slash before the first begin. It was indeed dropped during copy-paste.) – user855443 Apr 18 '18 at 10:43
2

I'd say that this is a bug in suftesi, which can be solved by doing a further check:

\begin{filecontents}{\jobname-test.tex}
\begin{article}
\author{Author}
\title{Title of the paper}
% The abstract is optional.
% \begin{abstract}
% The abstract
% \end{abstract}
\maketitle
Text of the paper
\end{article}
\end{filecontents}

\documentclass[structure=collection]{suftesi}
%process with pdflatex

\usepackage{etoolbox}

\makeatletter
\AtBeginDocument{%
  \patchcmd{\@maketitle}
   {%
    \xdef\@currentHref{title.\thearticle}%
    \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
   }
   {%
    \@ifundefined{Hy@raisedlink}{\let\texorpdfstring\@firstoftwo}{%
      \xdef\@currentHref{title.\thearticle}%
      \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
    }%
   }
   {}{}%
}
\makeatother

\begin{document}

\input{\jobname-test}

\end{document}

The filecontents environment has been used just for making the example self-contained.

If \Hy@raisedlink is not defined, we can assume hyperref has not been loaded (the \@ifundefined is performed when all packages have been loaded); in this case we define \texorpdfstring to return its first argument; otherwise, the same code as the current suftesi is executed.

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.