R: Removing the “Chapter” part from the title in bookdown::pdf_book with documentclass: report

折月煮酒 提交于 2020-01-02 07:46:30

问题


consider my header and first section

---
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

I want to remove the automatic "Chapter 1" part, thats sits in front of the actual chapter title (in this case Introduction) This does not work

header-includes:
  \renewcommand{\chaptername}{}

Also using another documentclass does not work, because I need the number of my sections/chapters be represented in the figure captions (e.g Figure 3.1) What I would like is to end up with a Title 1 Introduction , than 2 Methods and so on. Should not be to hard, but I can't figure it out. Thanks Greg


回答1:


You can use

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

together with

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

in preamble.tex (c.f. https://tex.stackexchange.com/questions/10326/how-to-set-the-chapter-style-in-report-class). You have to make sure that the LaTeX package titlesec is installed in your TeX system.

The subparagraph: true is needed since recent pandoc TeX templates redefine \paragraph and \subparagraph in a way interfering with titlesec.



来源:https://stackoverflow.com/questions/48271693/r-removing-the-chapter-part-from-the-title-in-bookdownpdf-book-with-documen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!