在书本中将after_body包括在目录中

时间:2019-07-18 08:12:45

标签: latex r-markdown bookdown

我正在创建pdf书,并希望在目录中包含after_body标头。我使用以下yaml:

$Authorization = "Bearer API-KEY"
$Accept = "application/json"
$Content = "application/json"
$Uri = "URL"
$body = Get-Content -Path "C:\123\test.txt" -Raw | ConvertTo-Json

$getTapes = Invoke-RestMethod -Method PUT -body $body -ContentType $content -Uri $Uri -Headers @{'Authorization' = $Authorization}

--- author: "name" date: "`r Sys.Date()`" site: bookdown::bookdown_site geometry: "left=4cm,right=3cm,top=3cm,bottom=3cm" subparagraph: true output: bookdown::pdf_book: toc: false citation_package: natbib includes: before_body: frontpage.tex after_body: after_body.tex in_header: preamble.tex fontsize: 11pt linestretch: 1.2 documentclass: book bibliography: [packages.bib, library.bib] biblio-style: apalike link-citations: yes --- 中,我有以下内容:

after_body.tex

如何在目录中包括“附则I-III”?我在\backmatter \begin{titlepage} \LARGE \textbf{Enclosed articles I - III} \end{titlepage} 文件的\tableofcontents之前用\mainmatter创建了toc。

编辑:我还注意到书本在\ titlepage乳胶环境之后创建了一个带有页码的空白页。这也发生在frontpage.tex中。有什么办法可以删除这些页面上的数字?

1 个答案:

答案 0 :(得分:0)

我设法通过将\ textbf更改为\ chapter并将其包含在preamble.tex中来做到这一点:

\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{13.6pt} % as requested by fancyhdr's warning

\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\makeatletter
\renewcommand{\chaptermark}[1]{%
  \if@mainmatter
    \markboth{Chapter \thechapter{}: #1}{}%
  \else
    \markboth{#1}{}%
  \fi
}

取自this post