1

Big picture, I am trying to develop an approach that will allow me to store the latex commands and labels (pre-expansion) that I use to typeset dynamic text (bib entries with cite, cross referencing with ref and cref, glossaries, and other labeled value retrieval with etoolbox) in a href. The reason I am pursuing this I hope to be able to create "hyperlinked" objects to their original latex code, so that when I send documents out, I can revert to the latex content with a custom macro or script that will replace text with the background hyperlink content, in this case the complete latex string.

As I have tried to illustrate in the example below, I am trying to create a proof of concept for this href approach to tackle expandable macro/command issues and my first attempt, is off to a reasonable start, i.e. cref expands just fine even in the second argument of href but I don't get a hoverable display like I do for a URL website (example of each is included below).

According to the documentation, there are many URL specific options so (without diving into the package code) I assume there are some some smart detection capabilities parsing for URLs. Can I force href to show the argument 1 content even when there is no website?

\documentclass{article}

\usepackage{xparse}
\usepackage{verbatim}

\renewcommand{\refname}{}

\usepackage{hyperref}
\usepackage{cleveref}

\begin{document}

    \section{Introduction}\label{Resources}

    See the test found in \cref{Resources}, \nameref{Resources}, \refname{Resources}

    Hovering over the following text:  \href{http://www.tobarandualchais.co.uk/}{Tobar an Dualchais - Kist o Riches} produces a hyperlink hoverbox.

    Example:  Hovering over the following text:  \href{\refname{Resources}}{\cref{Resources}}

\end{document}

Your Answer

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

Browse other questions tagged or ask your own question.