latex3 / latex3/hyperref

\hyper@anchorstart in draft mode wrong number of parameters

Open
#430 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
205
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Originally \hyper@anchorstart uses one parameter but in draft mode it is redefined to use two parameters (\def\hyper@anchorstart#1#2{#2\Hy@xspace@end}) and here comes bug with natbib.

\documentclass{book}
\usepackage{natbib}
\usepackage[draft]{hyperref}
\begin{document}
\begin{thebibliography}{1}
\bibitem[{Awwad(2016)}]{sss}
x
\end{thebibliography}
\end{document}

Tracing shows that \hyper@anchorstart is with one parameter but expects two:

\hyper@natanchorstart #1->\Hy@raisedlink {\hyper@anchorstart {cite.#1}}
#1<-sss\@extra@b@citeb 

\Hy@raisedlink ->

\hyper@anchorstart #1#2->#2\Hy@xspace@end 
#1<-cite.sss\@extra@b@citeb 
! Argument of \hyper@anchorstart has an extra }.
<inserted text> 
\par 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the minimal book, natbib, and draft-mode hyperref document in the issue. Trace the \hyper@natanchorstart to \Hy@raisedlink call and inspect the draft-mode definition of \hyper@anchorstart. Done means the example compiles without the extra-argument error while preserving draft-mode anchor behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, tex
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.