如何调用rstudio中的rmarkDown文档的自定义代码段

发布于 2025-02-03 09:00:17 字数 318 浏览 1 评论 0原文

很少有人可以在rstudio中用于rmarkDown文档。我通过全球选项定义了自己的片段>代码>编辑片段>降价。但这无效。如果我键入r并按Shift+Tab,则插入预定义的摘要。但是,当我想插入自己的片段时,它不起作用。例如,这是我想拥有的片段:

snippet custy
  :::{custom-style="${1:style}"}
  ${0}
  :::

我想在键入custy和按Shift+Tab时,将摘要插入我的文档中,但事实并非如此。摘要是否应以不同的方式定义?

There are few pre-defined snippets one can use in RStudio for Rmarkdown documents. I define my own snippets via Global Options > Code > Edit snippets > Markdown. But it doesn't work. If I type r and press Shift+Tab a pre-defined snippet is inserted. But when I want to insert my own snippet it doesn't work. For example, this is my snippet I'd like to have:

snippet custy
  :::{custom-style="${1:style}"}
  ${0}
  :::

I thought when I type custy and press Shift+Tab the snippet will be inserted into my document, but it doesn't. Should the snippet be defined differently?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心 2025-02-10 09:00:17

我尝试了您的剪切,效果很好。
确保您在“ Markdown”选项卡上。另外,凹痕还可以吗?片段应为蓝色。

I tried your snipped and it worked well.
Make sure you are on the "Markdown" tab. Plus, are indentations OK? the snippet should be colored blue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文