Document Classeshyperref, memoir | No Hyperlinks in ToC

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
drmCA
Posts: 31
Joined: Mon Aug 13, 2012 12:18 am

hyperref, memoir | No Hyperlinks in ToC

Post by drmCA »

I cannot get hyperref to work in memoir class despite following memoir manual and loading \usepackage{memhfixc} (although I did not have to as my LaTeX is the latest). The class guide is very confusing in itself.

Another issue is that commands such as \posttitle{abc...} do not seem to work, but first I need to get my hyperlinks back. What am I doing wrong?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref, memoir | No Hyperlinks in ToC

Post by localghost »

drmCA wrote:[…] What am I doing wrong?
A proper minimal example for sure will show.


Thorsten
drmCA
Posts: 31
Joined: Mon Aug 13, 2012 12:18 am

Re: hyperref, memoir | No Hyperlinks in ToC

Post by drmCA »

I do not see a need for a minimal example, as the only difference is document class. Switching from book to memoir removes hyperrefs. Not sure what could be not clear about that. Flip to memoir - no hyperref. Flip to book - hyperrefs appear. Please explain.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref, memoir | No Hyperlinks in ToC

Post by localghost »

drmCA wrote:I do not see a need for a minimal example, as the only difference is document class. […] Please explain.
I minimal example is needed very well, better said essential. I don't have any problems with this.

Code: Select all

% TeX program = pfdplatex
\documentclass[11pt,english]{memoir}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{blindtext}
\usepackage{hyperref}

\begin{document}
  \tableofcontents*

  \blinddocument
\end{document}
Well then? Now its your turn to explain.
drmCA
Posts: 31
Joined: Mon Aug 13, 2012 12:18 am

Re: hyperref, memoir | No Hyperlinks in ToC

Post by drmCA »

Ok, I am attaching the example and the pdf that it renders into.
Flipping the comments on document class re-activates hyperrefs.
Attachments
hyperref.zip
Memoir example with dead hyperrefs
(44.55 KiB) Downloaded 378 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: hyperref, memoir | No Hyperlinks in ToC

Post by cgnieder »

There you see why the MWE was needed! You're using memoir with the draft mode. It seems memoir's draft mode disables hyperref (although I didn't know that before...). Simply remove it and all hyperlinks will show.

Regards
site moderator & package author
drmCA
Posts: 31
Joined: Mon Aug 13, 2012 12:18 am

Re: hyperref, memoir | No Hyperlinks in ToC

Post by drmCA »

Thank you, works like a charm. Obscure option indeed.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

hyperref, memoir | No Hyperlinks in ToC

Post by localghost »

cgnieder wrote:[…] You're using memoir with the draft mode. It seems memoir's draft mode disables hyperref (although I didn't know that before...). […]
The draft mode disables hyper links in general, not only with memoir.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

hyperref, memoir | No Hyperlinks in ToC

Post by cgnieder »

localghost wrote:The draft mode disables hyper links in general, not only with memoir.
Which actually makes much more sense :)
site moderator & package author
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

hyperref, memoir | No Hyperlinks in ToC

Post by Stefan Kottwitz »

Packages inherit options from the document class options. So if you specify draft mode for memoir, it's also used for graphicx (disabling loading images) and for hyperref (disabling hyperlinks). You can specify options for packages when loading them, or override class options, such as by \hypersetup{final}.

Just don't use options which you don't know yet, to avoid undesired surprises.

Stefan
LaTeX.org admin
Post Reply