Label cross-reference labels in foxes

I am using pgfsweave with Lyx 1.6.8 and xtable. providing table headers

<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption"))
@.

How can I insert a label in the table title so that I can cross-reference in the text from the lyx> Insert> Cross-reference menu?

I tried to insert a table> float> and put print(xtable(<dataframe>,floating=FALSE))and "Here is my caption"in the internal frame header of the table but it leads to a (literally):

[float Table:
<...Table ...>
[Table 2: "Here is my caption" ] ]

Even a lateral cross-snapping solution

<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption",label = "tab:one"))
@

from ERT-box will help.

+3
source share
1 answer

SOLVE: Just use the TWO arguments in the xtablefunction call in the R code:

xtable(<dataframe>
, caption = "My caption\\label{tab:MyTable1}"
,label="tab:MyTable1")

\\label{tab:MyTable1}inside the header changes to \label{tab:MyTable1}through R and then LaTeX is interpreted.

label="tab:MyTable1" R , , , Lyx . "", "tab:MyTable1" ( ) .

+6

Source: https://habr.com/ru/post/1782808/


All Articles