Graphics, Figures & Tables ⇒ Subfigure link in List Of Figures don't redirect to the subf
-
- Posts: 2
- Joined: Sat Aug 20, 2016 11:20 pm
Subfigure link in List Of Figures don't redirect to the subf
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Subfigure link in List Of Figures don't redirect to the subf
I don't have this problem when I use memoir, figures and subfigures with hyperref.
Can you please post a

Stefan
-
- Posts: 2
- Joined: Sat Aug 20, 2016 11:20 pm
Subfigure link in List Of Figures don't redirect to the subf
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}}
Subfigure link in List Of Figures don't redirect to the subf
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.
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 "}".
Rainer