Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I recently experienced several issues after some packages got updated. The one remaining is that hyperref doesn't recognize \subsubsection{} anymore when using the apa6 class. The bookmarks in the PDF output are displayed as <Untitled>. The same is true for the example provided in the apa6 documentation. I added a minimal example that also produces the erroneous bookmarks. All the other referencing (citations, etc.) seems to work just fine.

\documentclass[jou]{apa6}

\usepackage{hyperref}

\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,sortcites=true,sorting=nyt]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{bibliography.bib}

\title{Sample}
\author{Author}
\affiliation{University}
\leftheader{Author}
\abstract{This is a test abstract.}
\keywords{APA6}

\begin{document}
\maketitle
\section{Method}
\subsection{Materials}
Several materials were used for this project. Some of them were
\subsubsection{Paper-and-Pencil Instrument}
We used an instrument that we found to be highly successful.
\printbibliography
\end{document} 
share|improve this question

1 Answer 1

up vote 4 down vote accepted

It seems that the author of apa6 redefined \subsubsection in order to add a period after the subsubsection's name. In doing so, however, he used the LaTeX kernel command \@startsection in a way that likely wasn't envisioned by the LaTeX team, and surely confuses hyperref.

In the following example, I have provided an alternative refinition of \subsubsection that resembles the one of \paragraph in the standard classes. A new command \addperi is used to add a period in a way that is compatible with hyperref. (As I'm not familiar with \@startsection, there's no guarantee that my redefinition doesn't break other things.)

EDIT: In case you are wondering why \addperi works in my redefinition, have a look at the description of \@startsection in section 61.2 of the LaTeX2e sources:

style: Commands to set style. Since June 1996 release the last command in this argument may be a command such as \MakeUppercase or \fbox that takes an argument. The section heading will be supplied as the argument to this command. So setting #6 to, say, \bfseries\MakeUppercase would produce bold, uppercase headings.

\documentclass[jou]{apa6}

\makeatletter
% Redefinition of \subsubsection found in apa6.cls
% \renewcommand{\subsubsection}[1]{\@startsection{subsubsection}{3}{1em}%
%     {0\baselineskip \@plus 0.2ex \@minus 0.2ex}%
%     {-\z@\relax}%
%     {\normalfont\normalsize\bfseries\hspace{\parindent}{#1}\textbf{.}}{\relax}}
% Alternative redefinition
\newcommand*{\addperi}[1]{#1.}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\parindent}%
    {0\baselineskip \@plus 0.2ex \@minus 0.2ex}%
    {-1em}%
    {\normalfont\normalsize\bfseries\addperi}}
\makeatother

\usepackage{hyperref}

\title{Sample}
\author{Author}
\affiliation{University}
\leftheader{Author}
\abstract{This is a test abstract.}
\keywords{APA6}

\begin{document}
\maketitle
\section{Method}
\subsection{Materials}
Several materials were used for this project. Some of them were
\subsubsection{Paper-and-Pencil Instrument}
We used an instrument that we found to be highly successful.
\end{document}

enter image description here

share|improve this answer
    
the great advantage of online forums is that you can bypass the author of a package altogether. but i've foiled your plot and mailed the author a link to this... –  wasteofspace Feb 20 '12 at 20:45
    
Since apa6 is a maintained document class, please e-mail a bug report to the maintainer. –  Axel Sommerfeldt Feb 20 '12 at 21:13
    
@AxelSommerfeldt I'll wait if the OP does. –  lockstep Feb 20 '12 at 21:14
    
+1 for pointing out that the definition of the \subsubsection command in the apa6 doc class is, well, suspect. –  Mico Feb 21 '12 at 2:55
    
I mailed the maintainer of course, but first I thought it might be an issue connected with my LaTeX distribution given the problems I had some days before already. Hence the post of the issue here... –  shkelda Feb 21 '12 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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