1

The solution proposed in this thread works and prints the numbers of the quotes referenced, but doesnt add a clickable link(?) to the referenced quote.

The reference appears in the text, but there is no link for me to click on the number and jump to the quote referenced. How can I fix this?

The following command was defined in order to reference the quote object:

\newcommand\quoteref[1]{\csname#1\endcsname}

I suspect that there might be something I could add here to make it a clickable text that would jump to the referred quote.

Thanks for your time and attention.

1 Answer 1

1

The solution in that thread is defective in a lot of ways. LaTeX already has its own referencing mechanism and that bypasses it which causes problems as you've seen.

Instead, I would define the lquote environment as follows:

\newcounter{numquote}
\newenvironment{lquote}{%
  \refstepcounter{numquote}%
  \quote}{\unskip~\thenumquote\endquote}

You would use this by something like

\begin{lquote}
  blah blah
  \label{quote:one}
\end{lquote}
...
quote~\ref{quote:one}.

Then, if you put

\usepackage{hyperref}

at the end of your preamble you'll automatically get the desired result with hyperlinks on the reference.

1
  • Great! that has the desired output. I've only added one thing to this which is the autoref name for lquote with: \newcommand*{\lquoteautorefname}{<desired name>} Commented Sep 19, 2020 at 14:52

You must log in to answer this question.

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