Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following MWE shows the effect of a line-broken glossary entry on an adjacent marginpar, as opposed to a non-line-breaking glossary entry. Why does line-brokenness contaminate the marginpar?

\documentclass[a4paper]{memoir}
\usepackage[xetex]{hyperref}
\hypersetup{colorlinks=true}
\usepackage{glossaries}
\makeglossaries
\loadglsentries{glossary}

\begin{document}

Here\marginpar{Here is a margin paragraph.} is a reference to the glossary word \glsname{tst-a}, \\\

and here\marginpar{Here is another margin paragraph.} is a reference to the glossary word \glsname{tst-b}, 


\glsaddall
\printglossaries

\end{document}

My glossary entries are defined as follows:

\newglossaryentry{tst-a}{%
name={a-short-glsname},
description={Definition of tst}}

\newglossaryentry{tst-b}{%
name={a-very-long-glsname-likely-to-line-break},
description={Definition of tsp}}

Sample result

share|improve this question

2 Answers 2

up vote 3 down vote accepted

This is not restricted to glossary entries. When hyperlinks are broken e.g. between two pages, then between the beginning of a link at one page and the end of the link on the next page everything is enclosed in the link: footnotes, pagenumbers, pageheader on the new page. In your case it is the link starting in one line and ending in the next one, therefore everything placed in the margin of the first line is linked (and because the margin entry is one "object", the whole one is made into a link). (Good that you only asked for "why" and not "how to get rid of it". If Heiko Oberdiek, the maintainer of the hyperref package, would know how to do it, he would have done it, but afaik there is currently no known solution to break the hyperlinks at line-/page-/column-borders.)

share|improve this answer

The same problem occurred to me using the hyperref package in combination with the glossaries package. A solution is found in FAQ, but you should use version 2.03.

From their site

How do I suppress the hyperlink for the first use just for acronyms? Use the footnote package option and do: \defglsdisplayfirst[\acronymtype]{#2#4 (\firstacronymfont{#1})} Note that this won't work for acronyms that belong to a glossary not given by \acronymtype. As from version 2.03, you can also use the package option hyperfirst=false to suppress the first use link for all terms (including acronyms).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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