R:从书本的标题中删除"Chapter"部分::p df_book with documentclass: report



>考虑我的标题和第一部分

---
title: "asdf"
author: "asdf"
date: "13 Januar 2018"
documentclass: report
output:
  bookdown::pdf_book:
    citation_package: biblatex
    latex_engine: pdflatex
    number_sections: yes
    fig_caption: yes
---
# Introduction
Here begins my introduction

我想删除自动的"第 1 章"部分,它位于实际章节标题的前面(在本例中为引言(这不起作用

header-includes:
  renewcommand{chaptername}{}

使用另一个文档类也不起作用,因为我需要在图表标题中表示我的部分/章节的数量(例如图 3.1(我想要的是最终得到标题 1 介绍 ,而不是 2 方法等等。应该不难,但我想不通。谢谢格雷格

您可以使用

subparagraph: true
output:
  bookdown::pdf_book:
    includes:
      in_header: preamble.tex

usepackage{titlesec}
titleformat{chapter}
  {normalfontLARGEbfseries}{thechapter}{1em}{}
titlespacing*{chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

preamble.tex(C.F.https://tex.stackexchange.com/questions/10326/how-to-set-the-chapter-style-in-report-class(。您必须确保 LaTeX 软件包titlesec已安装在 TeX 系统中。

在撰写本文时,需要subparagraph: true,因为使用的pandoc LaTeX模板重新定义了paragraph,并以干扰titlesec的方式subparagraph。从那以后,这种情况发生了变化。至少在 2.1 版rmarkdown不再需要 subparagraph: true .感谢@MarkNeal注意到这一点!

最新更新