I currently have a quote in my tex file like this:
\begin{quote}
blabla
\end{quote}
Now I want to refer to this quote inline. Adding a label works but I cannot get the caption
to work, in order to show that this quote is actually number x.y. As this environment does not seem to be a float environment, which is apparently a requirement for \caption{}
.
So I have tried the following:
\begin{quote}
blabla
\label{quote:one}
\end{quote}
And addint \caption{test}
right before the label does not work.
Best Answer
See below for Alternate Appearance. See ADDENDUM for version that uses aux file to allow future referencing
As Christian noted in a comment, a quote has no counter (and thus no identifying label). However, we could introduce one to the
lquote
environment, which requires a label as the argument, reference-able by\quoteref
.The implementation given below can be altered to suit the needs for quotation marks, numbering scheme and appearance, etc.
Alternate Appearance
ADDENDUM:
It seemed from the OP's comment that he may be using the
\quoteref
prior to the label definition in thelquote
environment. To account for that, I have in this addendum implemented a system of writing out to the aux file to make the labels available even before they are defined.Note: the
\protected@iwrite
macro came from egreg's answer at Writing \\ to a File.