相关疑难解决方法(0)

在YAML中,如何在多行中断字符串?

在YAML中,我有一个非常长的字符串.我想将它保留在我的编辑器的80列(或左右)视图中,所以我想打破字符串.这是什么语法?

换句话说,我有这个:

Key: 'this is my very very very very very very long string'
Run Code Online (Sandbox Code Playgroud)

我想要这个(或者这个效果):

Key: 'this is my very very very ' +
     'long string'
Run Code Online (Sandbox Code Playgroud)

我想使用上面的引号,所以我不需要在字符串中转义任何东西.

string syntax yaml

1388
推荐指数
8
解决办法
58万
查看次数

Rmarkdown yaml中的多个作者和副标题

我正在尝试按照此pandoc示例将多个作者添加到yaml元数据块中的Rmarkdown文件.pdf将在RStudio(版本0.98.932)中生成,但没有作者信息.

---
title:  'This is the title: it contains a colon'
author:
- name: Author One
  affiliation: University of Somewhere
- name: Author Two
  affiliation: University of Nowhere
date: "`r format(Sys.time(), '%d %B %Y')`"
tags: [nothing, nothingness]
abstract: |
  This is the abstract.

  It consists of two paragraphs.
output: pdf_document
---
Run Code Online (Sandbox Code Playgroud)

我还想更多地定制标题并添加一个副标题.可能?

yaml r rstudio r-markdown

43
推荐指数
7
解决办法
5万
查看次数

如何在rmarkdown的标题中强制换行?

我在rmarkdown文档中有一个很长的标题,我想强制在特定位置换行.

最小例子:

---
title: "Quite long title want the * line break at the asterisk"
output: html_document
---
Run Code Online (Sandbox Code Playgroud)

我试过了:\n,\newline,\\和手动换行符.他们似乎都没有工作.

我认为它必须非常简单,但我无法找到解决方案.

r r-markdown

38
推荐指数
2
解决办法
1万
查看次数

在标题中插入换行符

如何在rmarkdown文档的标题中插入换行符?这不起作用:

---
title: "title \break subtitle"
output: pdf_document 
---`
Run Code Online (Sandbox Code Playgroud)

r knitr r-markdown

11
推荐指数
1
解决办法
4493
查看次数

在 Rmarkdown 文档的 YAML-Header 部分包含额外的文本/超链接部分

我正在用 RMarkdown 编写一个文档,希望有一个关于在标题部分包含额外信息的相当简单的查询。

我的 rmd 的标题部分如下所示:

---
title: "My R-Markdown Document"

author: "[My name here](a hyperlink to my institutional page)"

output: html_document
---
Run Code Online (Sandbox Code Playgroud)

我正在尝试在我的名字后添加一个简单的额外行,其中包括我的 Twitter 句柄

我尝试通过将其添加为摘要来作弊....:

---
    title: "My R-Markdown Document"

    author: "[My name here](a hyperlink to my institutional page)"

    abstract: "[I'm on Twitter](hyperlink)"

    output: html_document
    ---
Run Code Online (Sandbox Code Playgroud)

但是在额外信息之前显示标题摘要,即我得到

“摘要:我在推特上”

而所需的输出是

标题文字

名称(超链接)

我在推特上(超链接)

有谁知道如何让这个工作?我查看了PANDOC 指南和其他示例,并尝试了各种将其称为描述、研究所的东西,但除了上面突出显示的问题的摘要之外,这些似乎都没有呈现。

注意:修改的额外查询这适用于 HTML 输出,但如果 output == PDF 似乎不适用于该领域的任何建议也欢迎!

yaml r r-markdown

5
推荐指数
1
解决办法
2138
查看次数

在 Rmarkdown 中将标题分成两行以进行单词输出

我已经看到了各种适用于 pdf 和 HTML 文档输出的解决方案。但是,对于文字输出,没有一个对我有用。当|按照此处的建议使用时:将标题拆分为多行?只是让整个标题消失了。这是代码:

---  
title: |
    | Supporting Information
    | Development and mechanistic bla bla.
author: Some people
output:
  word_document:
    reference_docx: ACS SI style for RMD.docx
mainfont: Arial
---
<style>
body {
text-align: justify}
 p {line-height: 1.5em;}
</style>
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激。

ms-word r-markdown

5
推荐指数
1
解决办法
2628
查看次数

如何在rosdown的ioslides演示文稿标题中强制换行?

html_document输出解决方案不适用于ioslides_presentation输出.如何在特定位置强制更改标题?

html_document输出解决方案产生非常奇怪的结果.

---
title: | 
  | This is an extremely long title
  | with a desired line break at a 
  | specific location
output: ioslides_presentation
---
Run Code Online (Sandbox Code Playgroud)

r r-markdown

3
推荐指数
1
解决办法
1401
查看次数

标签 统计

r-markdown ×6

r ×5

yaml ×3

knitr ×1

ms-word ×1

rstudio ×1

string ×1

syntax ×1