3

When I use hyperref in memoir and click the link of bibliography in the table of contents, I jump to the line just below Bibliography. (This behavior is different from when I click the other chapters in the table of contents.) How can I adjust? Here is the MWE.

\documentclass{memoir}
\usepackage[dvipdfmx]{hyperref}

\begin{document}

\frontmatter
\tableofcontents*

\mainmatter
\chapter{Main Body}
We all are on the sholders of giants~\cite{T}.

\backmatter
\begin{thebibliography}{9}
    \bibitem{T} S.~Tand, On the sholders of giants, (2017).
\end{thebibliography}

\end{document}
2
  • 1
    Do you really build the thebibliography environment by hand?
    – Mico
    Oct 13, 2017 at 11:09
  • @Mico Well, I do. But I don't have to (if it helps) and also understand this is not a modern nor smart solution. (I prefer this solution to avoid digging into TeXnical problems to adjust style for each journal.)
    – Orat
    Oct 13, 2017 at 12:08

1 Answer 1

6
+50

memoir is inserting an unnessary \phantomsection which moves the link destination down. Imho this is a bug that should be reported. A work around is:

\documentclass{memoir}
\usepackage{xpatch}

\makeatletter
\xpatchcmd\@memb@bchap{\phantomsection}{}{}{\fail}
\makeatother

\usepackage[dvipdfmx]{hyperref}

\begin{document}

\frontmatter
\tableofcontents*

\mainmatter
\chapter{Main Body}
We all are on the sholders of giants~\cite{T}.

\backmatter
\begin{thebibliography}{9}
    \bibitem{T} S.~Tand, On the sholders of giants, (2017).
\end{thebibliography}

\end{document}
2
  • Thank you for your answer. It works for me (except misspelling s/meakatother/makeatother; I cannot edit only those because of characters limit). If it a bug should be reported, where should I report to?
    – Orat
    Oct 15, 2017 at 14:01
  • 2
    I corrected the typo. Regarding the bug: write the maintainer of memoir @daleif. Oct 15, 2017 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .