xtable 标题中的标签用于在 lyx 中交叉引用
我将 pgfsweave 与 Lyx 1.6.8 和 xtable 一起使用。 通过如何在表格标题中插入标签来提供表格标题
<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption"))
@.
,以便我可以从 lyx> 插入 > 交叉引用菜单中的文本中交叉引用?
我尝试插入>浮动>表并插入 print(xtable(
和 表格标题内框架中的“这是我的标题”
但这会导致(字面意思):
[float Table:
<...Table ...>
[Table 2: "Here is my caption" ] ]
进行交叉引用的赤脚解决方法也会有所帮助。
<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption",label = "tab:one"))
@
即使是从 ERT-box
I am using pgfsweave with Lyx 1.6.8 and xtable.
providing table captions by
<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption"))
@.
How can I insert a label into the table caption that I can crossreference in the text from the lyx>Insert>Cross-reference menu?
I have tried to insert>float>table and insertedprint(xtable(<dataframe>,floating=FALSE))
and"Here is my caption"
in the Table caption inner frame
but this results in (literally):
[float Table:
<...Table ...>
[Table 2: "Here is my caption" ] ]
Even a barefoot workaround to crossreference
<<result=tex>>=
print(xtable(<dataframe>,caption="Here is my caption",label = "tab:one"))
@
from an ERT-box would help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决:
只需在 R 代码中的
xtable
函数调用中使用两个参数:标题内的
\\label{tab:MyTable1}
更改为\label{tab:MyTable1}
由 R 编写,然后由 LaTeX 解释。R 会忽略参数
label="tab:MyTable1"
,因此您可以随意欺骗 Lyx,使其允许交叉引用标签表标签。使用 Insert>label 在此处插入标签
"tab:MyTable1"
(不包括引号)。SOLVED:
Just use TWO arguments in the
xtable
-function call in the R-code:The
\\label{tab:MyTable1}
inside the caption is changed to\label{tab:MyTable1}
by R and then interpreted by LaTeX.The argument
label="tab:MyTable1"
is ignored by R and therefore at your disposal to trick Lyx into allowing for crossreferencing to the label table label.Use Insert>label to insert the label
"tab:MyTable1"
(excluding the quotes) here.