RMarkdown/Bookdown: Putting R markdown/bookdown cross references into a plot legend in a R chunk

I have a bookdown document with many equations with equation numbers. I want to put an equation number reference in a plot legend - pseudocode

\begin{equation}
\label{eq:Logistic4P}
{Absorbance = D + \frac{A-D}{1+\left(\frac{Concentration}{C}\right)^{1/B}}}
\end{equation}

(ref:eqLog) @ref(eq:Logistic4P)

plot(y~x)
legend('topright',legend=some reference to equation number)

Of course, the job is to get the bookdown equation reference into the r chunk, similar to putting a cross reference into a figure caption. Can someone point me in the right direction and just tell me it can't be done?

Thanks
David

References are resolved as post processing step in bookdown, so it is not possible to include a resolved reference in a content that is used in processing to create text in an image like a plot legend.

For Image caption it works, because they are text written under image that can be replace in a post processing step.

You could open a feature request but I am not sure how we could make the reference be resolved during the knitting process unfortunately. So for now it can't be done.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.