相关疑难解决方法(0)

Rstudio rmarkdown:单个PDF中的纵向和横向布局

我想知道如何使用rmarkdown生成在同一文档中同时具有纵向和横向布局的pdf.如果有一个纯粹的rmarkdown选择,甚至比使用乳胶更好.

这是一个小的,可重复的例子.首先,.Rmd在RStudio中渲染它(按Knit PDF按钮)会生成包含横向布局中所有页面的pdf:

---
title: "All pages landscape"
output: pdf_document
classoption: landscape
---

```{r}
summary(cars)
```

\newpage
```{r}
summary(cars)
```
Run Code Online (Sandbox Code Playgroud)

然后尝试创建一个混合纵向和横向布局的文档.其中的基本设置YAML是根据此处的"包含"部分完成的.该in_header文件"header.tex"只包含\usepackage{lscape},包建议的knitr景观布置在这里.该.tex文件与文件位于同一目录中.Rmd.

---
title: "Mixing portrait and landscape"
output:
    pdf_document:
        includes:
            in_header: header.tex
---

Portrait:
```{r}
summary(cars)
```

\newpage
\begin{landscape}
Landscape:
```{r}
summary(cars)
```
\end{landscape}

\newpage
More portrait:
```{r}
summary(cars)
```
Run Code Online (Sandbox Code Playgroud)

但是,此代码会导致错误:

# ! You can't use …
Run Code Online (Sandbox Code Playgroud)

pdf r rstudio knitr r-markdown

67
推荐指数
4
解决办法
3万
查看次数

是否有控制输出页面方向的选项(使用knitr-> pander-> pandoc-> docx)

我正在玩Tal的介绍,在现实世界的情况下尽可能少地产生单词表.(请参阅那里可重现的例子 - 谢谢,Tal!)在实际应用中,表格要宽,以便在面向纵向的页面上打印,但您可能不想拆分它们.

很抱歉,如果我在pandoc或pander文档中忽略了这一点,但在从R写入Word .docx文件时如何控制页面方向(纵向/横向)?

我可能应该加上我开始使用knitr + markdown,我还不熟悉LaTex语法.但是我在尝试完成我的工作时尽可能多地接受.

markdown ms-word pandoc knitr pander

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

标签 统计

knitr ×2

markdown ×1

ms-word ×1

pander ×1

pandoc ×1

pdf ×1

r ×1

r-markdown ×1

rstudio ×1