pdf - 根据在 RMarkdown 中编织为 pdf 还是 docx 更改标题级别
问题描述
我有一个大型项目,其中包含几个章节(或子章节),我可以成功地将其编成 pdf 或 docx。
这是master.Rmd
编织孩子们的chapterOne.Rmd
---
title: Title of My Project
author: "My Name"
csl: G:/My Drive/ZoteroRPlugin/styles-master/spectroscopy-letters.csl
output:
pdf_document:
includes:
in_header: styles/preamble.tex #not relevant to the question
keep_tex: yes
latex_engine: xelatex
number_sections: yes
word_document:
fig_caption: yes
toc: yes
reference_docx: styles/word-styles-reference_05.docx
link-citations: yes
documentclass: styles/thesis-umich3
bibliography: G:/My Drive/ZoteroRPlugin/Report_references.bib
---
```{r global_options, include=FALSE}
library(knitr)
knitr::opts_chunk$set(fig.align='center')
use_betterbiblatex = TRUE
```
\chapter{Introduction}
<!--# Introduction -->
```{r child = 'chapterOne.Rmd'}
```
\pagebreak
\chapter{Literature Review}
```{r child = 'chapterTwo.Rmd'}
```
\pagebreak
这是其中一个子文件的代码chapterOne.Rmd
。
---
output: pdf_document
---
```{r chapter1_options, include=FALSE}
library(knitr)
knitr::opts_chunk$set(fig.align='center')
use_betterbiblatex = TRUE
```
## Level 1 Heading
Insert Text Here
### Level 2 Heading
但是为了正确完成标题,我需要在编织到 docx 时增加标题级别(这是由于我需要使用 csl 文件)。由于\chapter{Introduction}
无法识别该命令(这很好)。
这是上传时的屏幕截图,docx
它为我提供了正确的标题
然而,这会导致pdf
不正确地调平。
我意识到我可以Ctrl+H
并且 to a to但这并不是每次我必须在编织到 pdf 和 docx 之间切换时做的最佳选择
Find/Replace
。##
#
有人对解决方法有任何想法吗?
解决方案
推荐阅读
- c++ - 使用 OpenCV\C++ 裁剪图像
- gpu - 带有 GPU_HIST 的 XGBOOST GridSearchCV 同时使用 GPU 和 CPU
- r - 我需要一种在 R 中的日期戳之间填充数据的方法
- python - AttributeError:“scoped_session”对象没有属性“get”
- python - 如何使用下面给出的 pandas 数据框在 python 中使用 seaborn 模块制作热图?
- event-handling - 为什么在基于编排的 Sagas 中需要命令?
- ios - 等待 ios speechSynthesizer.speak 完成话语
- wpf - DotNetCore 3.1 WPF 网格布局管理器问题
- javascript - 使用 React 钩子制作列表
- pandas - DataFrame where 和 query 的区别