# How to embed the list figures into the document's main ToC without bad effects on the PDF ToC

For a relatively short report I would like to merge the list of figures (LoF) into the document's table of contents. In two related questions, Gonzalo Medina has suggested to just change the file extension LaTeX uses for the LoF, so that entries for figures end up in jobname.toc:

However, if this approach is used in conjunction with hyperref (to get a PDF ToC), the figure entries end up on chapter level (level 0) in the PDF ToC – with the effect, that the figure becomes the father of all following section or subsection entries:

\documentclass{scrartcl}
\usepackage{tocloft}
\usepackage{subfig}
\usepackage{hyperref}

\makeatletter
\renewcommand\ext@figure{toc}
\makeatother

\newlength\mylen
\renewcommand\cftfigpresnum{Figure~}
\settowidth\mylen{\bfseries\cftfigpresnum\cftfigaftersnum}

\begin{document}

\tableofcontents
\section{Test Section One}
Text
\subsection{Subsection One.1}
\begin{figure}[!ht]
A
\caption{test figure}
\end{figure}
\subsection{Subsection One.2}
Text
\section{Test Section Two}
\begin{figure}[!ht]
A
\caption{another test figure}
\end{figure}
\begin{figure}[!ht]
\subfloat[][A subfigure]{A}
\subfloat[][A subfigure]{B}
\caption{test figure with subfigures}
\end{figure}
\subsection{Subsection Two.1}
Text
\end{document}


The following screenshot shows the problem: In the PDF ToC (left side), Subsection One.2 and even Test Section Two are nested below the entry for test figure. Moreover, the figures are missing the Figure <#> prefix:

Questions:

• How do I get the figure entries to appear on subsection level inside the PDF ToC?
• How to add the Figure <#> prefix to the PDF ToC entries?
• @dustin: Thanks, but the point is that I want the figures on subsection level only in the PDF ToC, not regarding references inside the document's body. Jun 24, 2013 at 20:12
• I never had that issue because I removed the figures from the sidebar view. They only show up in the TOC for me. I will remove the answer now. Jun 25, 2013 at 19:12

The level of figures inside the bookmarks / contents are specified by toclevel@<element>:
\usepackage[bookmarksdepth=4]{hyperref}