0

I want to be able to label and reference a particular text in my LaTeX document without necessarily making it appear inside an equation, align, or cases environment. How can I do this?

For example is it possible to have something like this?

"This is a simple text that also contains $an \quad inline \quad formula$ inside itself!"    (♣)


As we discussed in (♣), everything could be labeled and referenced later on in $\latex$!

If label could not do this, how can I do such thing so that I can have the same functionality outside those environments and avoid doing it manually by typing (♣) by hand every time?

epR8GaYuh
  • 2,432
Master.AKA
  • 215
  • 1
  • 7
  • 2
    So, basically, you're saying that some object to be cross-referenced doesn't come with a "hook" of any known kind or type (or "stuff", as you put it), not even a hook provided by the hyperref package. Yet, somehow, LaTeX is supposed to provide a mechanism for latching on to an object that offers no hooks. Why the "I don't want to use hyperlinks and other stuff" stance? Incidentally, what might this "other stuff" be that you're ruling out ex ante? Unless we know exactly what you're ruling out, it's not really possible to figure out what may, in your view, be permissible. – Mico Jun 04 '20 at 10:57
  • Maybe the "other stuff" part is ambiguous. I meant by it the align and equation environments. – Master.AKA Jun 04 '20 at 10:59
  • 2
    LaTeX's basic \label-\ref cross-referencing mechanism rests the premise that \label can "latch on" to a counter variable -- specifically, the counter variable most recently incremented by a \refstepcounter instruction. For instance, the \section{...} instruction increments a counter called section, and an equation environment increments a counter called, you guessed it, equation. Any \label instructions that follow \section or \begin{equation} will be associated with the current value of the appropriate counter. – Mico Jun 04 '20 at 11:02
  • Let's for example say, can we generate the same example above without using equation/align environments and by avoiding the text to be a link? Maybe hypertext can do that. I thought it always makes your text a hyperlink. – Master.AKA Jun 04 '20 at 11:03
  • Ah, I see. So can I define my own counters as well? Also, is it possible to use labels that use symbols like ♠, * (etc.) for a text and reference it later? How should I do that? – Master.AKA Jun 04 '20 at 11:07
  • 1
    Please see Link to arbitrary part of text? for information on using \hyperlink and \hypertarget. – Mico Jun 04 '20 at 11:11
  • About defining and using your own counters: I was under the impression that your premise was that the objects you wanted to cross-reference were not associated with counters such as equation; however, my impression may have been quite wrong. Sure, you could set up your own counter variables and increment them via \refstepcounter; I can guarantee, though, that your readers will have no idea what's going on when they start to see cross-references of the form <someobject 15> and cannot find any instances of <someobject>, let alone one that's numbered 15. – Mico Jun 04 '20 at 11:13

0 Answers0