1

My problem is, when using \autocite{} or \supercite with hyperref, the linking area is very small, its not touching the superscript anywhere, and in the middle of the line, not on the height of the superscript. I am using BibLaTeX.

\documentclass[]{article}

\usepackage[autocite=superscript,
    backend=biber,
    hyperref=true,
    url=false,
    isbn=false,
    doi=false,
    maxnames=4]{biblatex}
\usepackage[colorlinks=true]{hyperref}

\addbibresource{Wald.bib}


\begin{document}
Text\autocite{Wald}
\printbibliography
\end{document}

my dummy Wald.bib file:

@Article{Wald,
  author  = {Walter Ewald},
  title   = {Walten im Wald},
  journal = {Waldwerke},
  year    = {1208},
  date    = {1208-12-12},
}

@Comment{jabref-meta: databaseType:biblatex;}

I am currently using Windows 10, MiKTeX 2.9.7250 64-bit, pdfTeX Version 3.14159265-2.6-1.40.20. Normal quick compile is pdfTeX -> Biber -> 2x pdfTeX -> divps -> ps2pdf, but the problem is still there when only using pdftex. In the following picture, the clickable area is highlighted blue (it is the same with colorlinks=false, so I didnt include a picture for that)

Output with highlighted link area.

  • 1
    Hello, place your minimum example and what you are compiling with, if you want you can add an image to understand more about it, you don't need to upload the PDF – Pablo González L Jan 15 at 18:12
  • The MWE in this case should just reproduce the problematic output in the PDF with as little code as possible. It is not an issue that you can't upload a PDF, we just need code that reproduces what you are complaining about. – moewe Jan 15 at 19:13
  • 1
    Mhhh, the link I get from the MWE appears to be alright (its area is basically a small box around the superscript 1). Can you please tell us how you compile your document (pdfLaTeX, LuaLaTeX, XeLaTeX, LaTeX to DVI) and a bit more about your system (what OS, MikTeX or TeX live, what versions)? If you load hyperref just with \usepackage{hyperref} instead of \usepackage[colorlinks=true]{hyperref} does the size of the link box look right? Can you include a screenshot of the PDF in the question (ideally one with \usepackage{hyperref} and one with \usepackage[colorlinks=true]{hyperref})? – moewe Jan 15 at 20:53
  • 1
    Does the problem really also occur if you compile with pdfLaTeX (and not with dvips and ps2pdf)? Somehow the sequence pdfTeX -> divps -> ps2pdf doesn't make sense, since pdfTeX would usually produce PDFs, but dvips -> ps2pdf takes a DVI and turns it into a PS and then PDF. So if there was a DVI, the PDF produced by pdfTeX is overwritten by the DVI-produced PDF. I have a hunch this might be the same issue as tex.stackexchange.com/q/524044/35864 – moewe Jan 16 at 6:56
  • Mhhh, turns out it is not the same issue as tex.stackexchange.com/q/524044/35864. There is a shorter MWE at chat.stackexchange.com/transcript/message/53242241#53242241 – moewe Jan 16 at 7:25
4

The problem is that \textsuperscript sets \baselineskip to 0pt (\z@):

\def\@textsuperscript#1{%
  {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\z@#1}}}}}

On the other side \hyper@linkend uses \baselineskip:

\def\hyper@linkend{%
  \literalps@out{\strip@pt@and@otherjunk\baselineskip\space H.L}%

Setting \baselineskip to a positive value e.g. \textsuperscript resolves the problem:

\documentclass[]{article}

\usepackage[autocite=superscript]{biblatex}
\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}


\begin{document}
Text\autocite{doody}

\makeatletter
\def\@textsuperscript#1{%
  {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\sf@size#1}}}}}
\makeatother  

Text\autocite{doody}
\end{document}

enter image description here

But the main question is where this should done at best. See also https://github.com/latex3/hyperref/issues/115

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.