Graphics, Figures & TablesSubfigure link in List Of Figures don't redirect to the subf

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
vishaljadhav2060
Posts: 2
Joined: Sat Aug 20, 2016 11:20 pm

Subfigure link in List Of Figures don't redirect to the subf

Post by vishaljadhav2060 »

Subfigure link in List Of Figures don't redirect to the subfigure

I am having some problems with my List Of Figures in memoir document class.

When I go to the list of Figures, the link for the main caption works well and redirects to the right page.

But when I click on the link on one of the captions of the subfigure, I get redirected to the 1st page of my report.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10316
Joined: Mon Mar 10, 2008 9:44 pm

Subfigure link in List Of Figures don't redirect to the subf

Post by Stefan Kottwitz »

Welcome to the forum!

I don't have this problem when I use memoir, figures and subfigures with hyperref.

Can you please post a Infominimal working example that shows the issue?

Stefan
LaTeX.org admin
vishaljadhav2060
Posts: 2
Joined: Sat Aug 20, 2016 11:20 pm

Subfigure link in List Of Figures don't redirect to the subf

Post by vishaljadhav2060 »

The LaTeX code :

Code: Select all

\documentclass{memoir}
\usepackage{graphicx}
\usepackage[lofdepth,lotdepth]{subfig}
\usepackage[list=true]{subcaption}
\usepackage{subfloat}

\setcounter{lofdepth}{2}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue, citecolor=purple]{hyperref}

\begin{document}
\listoffigures

\chapter{My chapter}

\begin{figure}[H]
\centering
\subfloat [Scanner]{\label{fig:8.1a}
	\includegraphics[scale=0.40]{fig/reader2.png}}
\subfloat [Scanner Handling]{\label{fig:8.1b}
	\includegraphics[scale=0.53]{fig/reader1.jpg}}
\caption{\label{fig:8.1}Startek FM220}
\end{figure}

\end{document}}

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Subfigure link in List Of Figures don't redirect to the subf

Post by rais »

Hi,
you're trying to use two, possibly three different packages that try to give similar functionality.
That can not work.
You even get an error:

Code: Select all

! Package subcaption Error: This package can't be used in cooperation
(subcaption)                with the subfig package.
Try s.th. like

Code: Select all

\documentclass{memoir}
\usepackage[demo]{graphicx}
%\usepackage[lofdepth,lotdepth]{subfig} <-- subcaption is not compatible to this package
\usepackage[list=true]{subcaption}
%\usepackage{subfloat}

\setcounter{lofdepth}{2}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue, citecolor=purple]{hyperref}

\begin{document}
\listoffigures

\chapter{My chapter}

\begin{figure}%[H] <-- unknown option
  \centering
  \begin{subfigure}[b]{0.3\linewidth}
    \includegraphics[width=0.8\linewidth]{fig/reader2.png}% scale=0.40
    % using the scale option would require me to know the graphic's dimensions...
    \caption{Scanner}
    \label{fig:8.1a}% <-- I would use something I could remember the label by, say, "fig:scanner"
  \end{subfigure}%
  \hspace{1em}% <-- optional space between the subfigures
  % \hfill instead of \hspace{..} would fill the gap completely
  \begin{subfigure}[b]{0.3\linewidth}
    \includegraphics[width=\linewidth]{fig/reader1.jpg}
    \caption{Scanner Handling}
    \label{fig:8.1b}
  \end{subfigure}
  \caption{\label{fig:8.1}Startek FM220}
\end{figure}

\end{document}

% though not a problem, since everything after "\end{document}" is ignored, there was an additional closing brace "}".
KR
Rainer
Post Reply