Document Classes ⇒ Disable hypertext links in hyperref!?
-
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Disable hypertext links in hyperref!?
Is there a way to disable hypertext links in a document that uses the hyperref package? Or alternatively disable linking from just the TOC/LOF/LOT? I know this seems a little extreme as the package was designed to do exactly that but I have good reason:
- 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
- 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
NEW: TikZ book now 40% off at Amazon.com for a short time.
Disable hypertext links in hyperref!?
Have you tried the obvious first attempt: reading the hyperref documentation?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
Yeah I forgot to mention that. I have read the documentation cover-to-cover but not spotted an answer...
-
- 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 one
Chris
-
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
And I just installed the latest version of hyperref (6.77u) but it hasn't made any difference...
- Stefan Kottwitz
- Site Admin
- Posts: 10323
- Joined: Mon Mar 10, 2008 9:44 pm
Disable hypertext links in hyperref!?
Hi Chris,
at least it will work if the figures are not counted by chapter, try:
Stefan
at least it will work if the figures are not counted by chapter, try:
Code: Select all
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
LaTeX.org admin
-
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
Thanks Stefan,
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
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!?
Hi wheely_chairs,
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.
Besides solving the problem with hyperref, the syntax of the new subfigure and subtable environments is more "natural", in the sense that it is analogous to that of the standard figure and table environments.
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}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 26
- Joined: Mon Jun 16, 2008 1:22 pm
Re: Disable hypertext links in hyperref!?
Thanks for your reply gmedina. However, I know I'm being stupid, but how do I get the subcaption package!? I'm using TeXShop with TeXLive-2007 on a Mac (OS X 10.5).
Thanks,
Chris
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¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10