0
我正在使用RStudio和RMarkdown生成報告。我現在想編輯文檔的一部分。我的RMarkdown文檔如下:是否可以刪除RMarkdown .pdf中的內容標題?
--
title: <center> <h1>Call Centre Report</h1> </center>
mainfont: Arial
output:
pdf_document:
latex_engine: xelatex
sansfont: Arial
fig_crop: false
toc: true
classoption: landscape
fontsize: 14pt
geometry: margin=0.5in
header-includes:
- \usepackage{booktabs}
---
<style>
.main-container {
max-width: 1200px !important;
}
</style>
```{r global_options, R.options=knitr::opts_chunk$set(warning=FALSE, message=FALSE)}
```
\newpage
# Iris
```{r fig.width=18, fig.height=7, echo=FALSE, comment=" "}
library(ggplot2)
ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) +
geom_point() +
theme_classic()
```
<br>
<br>
```{r, echo=FALSE, results='asis'}
library(knitr)
library(xtable)
t1 <- kable(subset(iris, Sepal.Length=="5.1", select = Petal.Length:Species),
format = "latex", booktabs = TRUE, row.names = FALSE)
t2 <- kable(subset(chickwts, feed=="horsebean", select = weight:feed),
format = "latex", booktabs = TRUE, row.names = FALSE)
t3 <- kable(subset(mtcars, gear=="4", select = disp:wt),
format = "latex", booktabs = TRUE, row.names = FALSE, digits=2)
cat(c("\\begin{table}[!htb]
\\begin{minipage}{.35\\linewidth}
\\centering",
t1,
"\\end{minipage}%
\\begin{minipage}{.35\\linewidth}
\\centering",
t2,
"\\end{minipage}%
\\begin{minipage}{.35\\linewidth}
\\centering",
t3,
"\\end{minipage}
\\end{table}"
))
```
是否可以刪除TOC頁面上的標題「內容」?我希望在此頁面上保留所有其他標題,但只刪除「內容」標題。
我知道我可以通過下面的行編輯「目錄」:
- \renewcommand{\contentsname}{Some Text Here}
但是僅僅保留爲空(如下圖),仍然佔用空間:
- \renewcommand{\contentsname}{}
如果使用Latex,你可能需要這樣做:https://tex.stackexchange.com/questions/55080/how-to-hide-the-table-of-contents-heading – Marius
或者只是結合'\更新命令{\ contentsname} {}'帶有負面的vspace:'\ vspace { - 。5cm}' –
命令' - \ renewcommand {\ contentsname} {} \ vspace { - 。5cm}它不會將文本推送到標題正式所在的位置。因此,仍然有一個白色空間。 – user2716568