Generalhyperref in subscripts (using LaTeX compiler)

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tyltus
Posts: 12
Joined: Tue Nov 10, 2009 12:03 pm

hyperref in subscripts (using LaTeX compiler)

Post by tyltus »

Hello

In a previous topic it was found out that my problem statement was too specific (by defining the hyperlink via the glossary package), so I hope it is correct to start a new topic with the real problem:

The hyperref package works fine in subscripts if the document is compiled using PDFLaTeX. However, the subscripts layout is reset when compiling with LaTeX, as can be seen using the following minimal example: (thank you nlct)

Code: Select all

    \documentclass{article}
    \usepackage[colorlinks]{hyperref}
    \begin{document}
    $a_{\hyperlink{target}{u}}\qquad a_{u}$
    \end{document}
(The hyperlinked subscript u looks different in the LaTeX result)

Does anyone see a way that the LaTeX result can be made to look the same as the one produced by PDFLaTeX? Any help would be very much appreciated!

Best regards
Martin

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

hyperref in subscripts (using LaTeX compiler)

Post by frabjous »

It looks like the latex version takes it out of math mode.

Try this:

Code: Select all

    \documentclass{article}
    \usepackage[colorlinks]{hyperref}
    \begin{document}
    $a\hyperlink{target}{\ensuremath{_{u}}}\qquad a_{u}$
    \end{document}
That looks the same to me with both latex and pdflatex.
tyltus
Posts: 12
Joined: Tue Nov 10, 2009 12:03 pm

Re: hyperref in subscripts (using LaTeX compiler)

Post by tyltus »

Ah, ok; so there exists a simple fix for a normal hyperlink - thank you very much!

Now the question remains how to fix the problem when the hyperlinks are created by glossaries (or other packages), but I will pose that in the original thread.

Best regards
Martin
Post Reply