Generalhyperref fails

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ThisEndUp
Posts: 2
Joined: Sat Feb 25, 2023 9:56 pm

hyperref fails

Post by ThisEndUp »

I have a LaTex document (several, actually) that ran beautifully six years ago but fails now.
Below is a short document that generates the error (which is not particularly helpful; see 5 below).

QUESTION: what do I do to cure the "Undefined control sequence"?

Thanks.

Code: Select all

Code, edit and compile here:
\date{May 2017}
\documentclass[12pt]{book}
\usepackage{hyperref}
%
\title{\Huge TITLE ONE \\[2ex]
INSTRUCTION MANUAL}
\author{{\Large\bf Curious Writers, Inc.}\\[12pt]
404 Web Drive\\
My Oh, MY 00101\\[24pt]
{\normalsize (000) 911-0988}\\
{\normalsize http://www.nonesuch.com}\\
{\normalsize support@nonesuch.com}\protect\\[20ex]
\small\copyright\ 2017 by Curious Writers, Inc.\\
\small All Rights Reserved
}
%
\begin{document}
\maketitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
And here's the console output:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 23.1) (preloaded format=pdflatex.fmt)
restricted \write18 enabled.
entering extended mode
(C:/xxx/yyy/Docs/HyperrefQ.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-02>
(C:\Program Files\MiKTeX\tex/latex/base\book.cls
Document Class: book 2022/07/02 v1.4n Standard LaTeX document class
(C:\Program Files\MiKTeX\tex/latex/base\bk12.clo))
(C:/Local/TexMFLocal\tex/latex/hyperref\hyperref.sty
(C:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty)
(C:/Local/TexMFLocal\tex/latex/hyperref\pd1enc.def)
Implicit mode ON; LaTeX internals redefined
(C:/Local/TexMFLocal\tex/latex/other/URL\url.sty))
*hyperref using default driver hpdftex*
(C:/Local/TexMFLocal\tex/latex/hyperref\hpdftex.def
(C:\Program Files\MiKTeX\tex/latex/psnfss\pifont.sty
(C:\Program Files\MiKTeX\tex/latex/psnfss\upzd.fd)
(C:\Program Files\MiKTeX\tex/latex/psnfss\upsy.fd)))
(C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-pdftex.def)
No file HyperrefQ.aux.
(C:/Local/TexMFLocal\tex/latex/hyperref\nameref.sty)

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\\' on input line 18.

! Undefined control sequence.
\@hyper@@anchor ...: #2#3}\else \def \anchor@spot
{#2#3}\let \put@me@back \@...
l.18 \maketitle

?
Comments about the error:
1) The LaTex file runs to completion and produces a proper document using a version of TeXWorks & MikTex installed a couple of years ago on a similar machine.
2) The hyperref Warning is just a warning. The older version complains about this and many other tokens as well, but it doesn't display the complaints by default. Clicking on "Errors, warnings, badboxes" reports, "Errors: 0, Warnings: 21, Bad boxes: 0".
3) The error occurs whether or not \maketitle (line 18) is commented out.
4) The error does not occur if \usepackage{hyperref} (line 3) is commented out.
5) I have no idea where the control sequence is invoked, other than it must be somewhere deep in the guts of hyperref.

Recommended reading 2024:

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

hyperref fails

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

What version is written at the beginning of C:/Local/TexMFLocal\tex/latex/hyperref\hyperref.sty?

You have a LaTeX tree (with a current hyperref I assume) in C:\Program Files\MiKTeX\tex/latex/, but you also have a hyperref in C:/Local/TexMFLocal\tex/latex/ which is used, may be older or incompatible with the current MiKTeX.

Stefan
LaTeX.org admin
ThisEndUp
Posts: 2
Joined: Sat Feb 25, 2023 9:56 pm

hyperref fails

Post by ThisEndUp »

Thanks for your quick reply. The TexMFLocal version shows
\ProvidesPackage{hyperref}
[2001/10/11 v6.71r
Hypertext links for LaTeX]

and the Program Files version shows
\ProvidesPackage{hyperref}
[2022-11-13 v7.00u %
Hypertext links for LaTeX]


So, I can see that the TexMFLocal version is a couple of decades(!) older.

Even before I posted my original query, I did try to rearrange the order of file search using MikTex's console. When I open the Settings | Directories tab, I see that TexMFLocal is above Program Files version, and I have found no way to rearrange these. In particular, the up and down arrows above the table of files are inactive (grayed out) no matter which directory I highlight. And removing and then adding the TexMFLocal directory always places it above the Program Files\MikTex directory (which I cannot remove).

I assume that this behavior is "by design".

I've now removed the entire hyperref directory from the C:\Local\TexMFLocal\tex\latex directory, and the current problem has disappeared.

However, I have a lot of other packages in the TexMFLocal tree that could potentially cause trouble, so I'd really like them to be found only if there isn't a newer one in the current MikTex distribution. I assume that's what would happen if I could change the order. Is there something I'm missing?

Many thanks.
Post Reply