sta*_*ver 9 r r-markdown bookdown
突然,我在 Markdown/Bookdown 中编织到 PDF 时遇到错误。我的系统没有任何改变。
错误是由“水平规则”引起的,即 --- 或 *** 在降价中的任何地方,尽管两边都有行空间。
我包含了一个简单的违规示例——它不会编入 PDF。
顺便说一下,编织成另一种格式不会引起问题,没有水平线的编织成 PDF 也不会产生错误。此外,交换 --- 为 *** 以探索这是否解决了错误。它没。
任何人都可以提供任何见解吗?
分别使用 TinyTex 和 MikteX(未安装在一起)。既不能解决问题。才刚刚遇到这个问题。以前编织没有问题的文件现在在遇到 --- 或 *** 时失败。
## R Markdown
Some text, then I want horizontal rule
---
Some text after the horizonatal rule.
Run Code Online (Sandbox Code Playgroud)
! Missing number, treated as zero.
<to be read again>
\protect
l.146 ...nter}\rule{0.5\linewidth}{\linethickness}
\end{center}
Error: Failed to compile K.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See K.log for more info.
Execution halted
Run Code Online (Sandbox Code Playgroud)
更新:此问题已在rmarkdown v2.1中修复,如果您(重新)从 CRAN安装最新版本的rmarkdown,该问题应该会消失。
这是 pandoc 中的一个已知且已修复的错误。 https://github.com/jgm/pandoc/issues/5801
它发生在较新版本的 TexLive 上。
这将在下一个 pandoc 版本中修复。您将不得不等待或使用每晚构建。
您现在还可以通过将其添加到 tex 文档的标题中来使用技巧。
\renewcommand{\linethickness}{0.05em}
Run Code Online (Sandbox Code Playgroud)
使用 rmarkdown 你可以做到
---
title: "Untitled"
output:
pdf_document:
keep_tex: true
includes:
in_header: header.tex
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{cat, engine.opts = list(file = "header.tex")}
\renewcommand{\linethickness}{0.05em}
```
lalalala
---
lilili
Run Code Online (Sandbox Code Playgroud)
您也可以header.tex手动编写文件,或将其添加到模板中。
这对我有用。
因此,在找到更永久的解决方案之前,对我有用的临时解决方案是:
\begin{center}\rule{3in}{0.4pt}\end{center}
Run Code Online (Sandbox Code Playgroud)
用这个代替---或***
| 归档时间: |
|
| 查看次数: |
1566 次 |
| 最近记录: |