On Sat, Jul 11, 2015 at 6:53 PM, Rich Shepard <rshep...@appl-ecosys.com> wrote:
>> http://yihui.name/knitr/options/
>
>
> Liviu,
>
>   I'm becoming more comfortable with knitr in lyx, yet cannot find answers
> to some questions in the above page. For example, in a figure chunk I create
> an option box and enter fig.cap='some caption text' and fig.lp=1 as the
> lable prefix. What I have not found is how to enter a cross-reference to
> that figure.
>
If you rely on knitr for the bookkeeping, then you would need to
copy/paste an existing cross-reference from your document and then use
e.g. "fig:foo-plot" in the cross-ref. LyX will probably complain that
it doesn't exist (displaying BROKEN), but in principle it should work
on compilation.

Another way to do this is to keep figure floats, labels and cross-refs
exclusively in LyX. So the chunk would simply output a graph, and you
place the chunk within a LyX float (with associated caption and
label). Then use normal LyX workflow.

Regards,
Liviu

>   When I follow the menus to enter a cross-reference the choice box is
> empty. In Yihui's knitr book I find no presentation of figure options nor
> how to reference them.
>
> Rich



-- 
Do you think you know what math is?
http://www.ideasroadshow.com/issues/ian-stewart-2013-08-02
Or what it means to be intelligent?
http://www.ideasroadshow.com/issues/john-duncan-2013-08-30
Think again:
http://www.ideasroadshow.com/library

Reply via email to