TransWikia.com

How to reference a quote environment?

TeX - LaTeX Asked by Lucas Azevedo on February 5, 2021

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:

newcommandquoteref[1]{csname#1endcsname}

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.

One Answer

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~thenumquoteendquote}

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.

Answered by Don Hosek on February 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP