Document Classes ⇒ Disable hypertext links in hyperref!?
-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Disable hypertext links in hyperref!?
- Subfigure links in the LOF are broken (i.e. they just point at the first page). I have been unable to reproduce this behavious in an MWE so I'm rather stumped. But links to subfigures in the main document still work.
- If it doesn't all work (the linking that is) then I'd rather not have it at all
- hyperref is still useful for defining properties of the pdf (author, title, etc) as well as adding bookmarks (which are still great ways to navigate a document)
So I'd just like to retain the bookmarking and document properties basically (and possibly non-TOC/LOF/LOT links). Any ideas?
Thanks,
Chris
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Disable hypertext links in hyperref!?
-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Disable hypertext links in hyperref!?
Ok so I've now identified the cause of this problem and created an MWE:wheely_chairs wrote:Subfigure links in the LOF are broken (i.e. they just point at the first page). I have been unable to reproduce this behavious in an MWE so I'm rather stumped. But links to subfigures in the main document still work.
Code: Select all
\documentclass[12pt, titlepage]{report}
\usepackage{subfig}
\setcounter{lofdepth}{2}
\usepackage[pdftex]{hyperref}
%%%%%%%% Document %%%%%%%%
\begin{document}
\listoffigures
\newpage
%\chapter{My First Chapter}
\begin{figure}
\subfloat[Subfigure 1 LoF entry][Subfigure 1 Caption]{
\makebox[0.45\textwidth]{\framebox[0.45\textwidth]{\rule{0pt}{0.45\textwidth}}}
\label{subfigure1}
}
\hspace{0.1\textwidth}
\subfloat[Subfigure 2 LoF entry][Subfigure 2 Caption]{
\makebox[0.45\textwidth]{\framebox[0.45\textwidth]{\rule{0pt}{0.45\textwidth}}}
\label{subfigure2}
}
\caption[Short caption for LoF]{Really long caption for entire figure}
\label{figure1}
\end{figure}
\end{document}Code: Select all
%\chapter{My First Chapter}Code: Select all
pdfTeX warning (dest): name{figure.1.1} has been referenced but does not exist, replaced by a fixed one
pdfTeX warning (dest): name{chapter.1} has been referenced but does not exist, replaced by a fixed oneChris
-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
Disable hypertext links in hyperref!?
at least it will work if the figures are not counted by chapter, try:
Code: Select all
\usepackage{chngcntr}
\counterwithout{figure}{chapter}-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
I'm not sure that numbering figures in this way is as elegant but at least it fixes my problem (beggers can't be choosers)!! I'm sure I did read somewhere that hyperref breaks when you redefine counters or some such... is that something like what this package does? (Many aspects of LaTeX are still Greek to me, lol!)
Thanks again,
Chris
Disable hypertext links in hyperref!?
Yes, they can.wheely_chairs wrote:(beggers can't be choosers)!!
Your problem admits a better solution. Use the subcaption package (documentation here) instead of subfig. The little but powerful subcaption package comes as a complement to the caption package (English documentation here). Refer to the documentations for further information.
Code: Select all
\documentclass[12pt,titlepage]{report}
\usepackage{caption}
\usepackage[list=true]{subcaption}
\usepackage[pdftex]{hyperref}
\begin{document}
\listoffigures
\newpage
\chapter{My First Chapter}
\begin{figure}
\begin{subfigure}[b]{.5\linewidth}
\centering
\rule{3cm}{2cm}
\caption[Subfigure LoF entry]{A subfigure}
\label{fig:1a}
\end{subfigure}%
\begin{subfigure}[b]{.5\linewidth}
\centering
\rule{3cm}{2cm}
\caption[Subfigure LoF entry]{Another subfigure}
\label{fig:1b}
\end{subfigure}
\caption[Figure LoF entry]{A figure with a really long caption}
\label{fig:1}
\end{figure}
\end{document}-
wheely_chairs
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
Thanks,
Chris
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Disable hypertext links in hyperref!?
Since Version 3.1 this package is a part of caption and represents some kind of replacement for subfig, which seems not to be maintained anymore. It has its own documentation where you can find useful information.wheely_chairs wrote:[...] However, I know I'm being stupid, but how do I get the subcaption package!? [...]
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10