Text Formattinghyperref, glossaries and superscript after \gls{}...

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
biaaas
Posts: 2
Joined: Mon Mar 21, 2011 5:42 pm

hyperref, glossaries and superscript after \gls{}...

Post by biaaas »

Hello,
I came here because I ran into a problem which I can not solve properly. I also could not find anything in the web.
As you can see in my example I use hyperref together with glossaries (and pdflatex):

Code: Select all

\documentclass[a4paper,12pt,]{scrbook}

\usepackage[pdftex]{hyperref}
\usepackage{glossaries}

\newcommand{\dF}{\texorpdfstring{\gls{dF}}{Gamma}}
\makeglossaries
\begin{document}
\newglossaryentry{dF}{name = \ensuremath{\Gamma_{\mathrm{Spin}}}, description = blablabla}
\printglossaries
text text text  $\dF^{\|} dfdf $
\end{document}
I have some entries in my glossary which contain a subscript, like the one above. Sometimes I want to add a superscript to this entry but the superscript is set next to the glossary entry. The result looks then more like this:

Code: Select all

$\Gamma_{\mathrm{Spin}} \, ^{\|}$
When I load the glossaries package before hyperref all looks fine, but then, of course, the links wont work any more.

Is there solution or workaround for my problem?

Thanks biaaas!
Last edited by biaaas on Tue Mar 22, 2011 11:00 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

hyperref, glossaries and superscript after \gls{}...

Post by nlct »

Hi,

try

Code: Select all

$\gls{dF}[^{\|}] dfdf$
Regards
Nicola Talbot
biaaas
Posts: 2
Joined: Mon Mar 21, 2011 5:42 pm

hyperref, glossaries and superscript after \gls{}...

Post by biaaas »

nlct wrote:Hi,

try

Code: Select all

$\gls{dF}[^{\|}] dfdf$
Regards
Nicola Talbot

Thanks a lot, that solved my problem.
I was not aware to the "insert" option of the gls command :oops: .
Post Reply