# maketitle is undefined for articles in a suftesi book

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?

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.
{\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

\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

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}%
}
{%
\xdef\@currentHref{title.\thearticle}%
}%
}
{}{}%
}
\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.