如何在tinytex data.table()中获取上标
我正在使用data.table()
打印表 - 在PDFS中。在这些表中,我想要一些带有上标的文本。我已经尝试了一对夫妻,但是我只找到使用kable()
或tibble()
的解决方案 - 但我真的想使用data。 table()
或使用expression()
- 我无法在PDF中工作的解决方案。
这是一些简单的示例代码。
library(data.table)
some_table <- data.table(
element = c('Some text with <1> in superscript at the end',
'Some more text')
)
先感谢您!
I am printing tables - in PDFs - by using data.table()
. In these tables, I want some texts with superscript. I've tried a couples of things, but I only find solutions which are using kable()
or tibble()
- but I really want to use data.table()
or solutions which are using expression()
- which I cannot get working in PDFs.
Here is some simple example code.
library(data.table)
some_table <- data.table(
element = c('Some text with <1> in superscript at the end',
'Some more text')
)
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
sup
表示上标,使用sub
表示下标。也许你想要这样的东西:输出:
data.table 不支持
data.table
包似乎不支持上标表达式。尝试时出现以下错误:使用此代码时:
You can use
sup
for superscript andsub
for subscript. Maybe you want something like this:Output:
Not supported with data.table
It seems like that superscripts expressions are not supported with the
data.table
package. You get the following error when trying:When using this code:
Rmarkdown + LaTeX 的两个选项:
Two options with Rmarkdown + LaTeX: