尝试在没有 gitbook 输出的情况下格式化书



回复第一个回复。

我正在尝试构建一本不是gitbook的书。然而,无论我尝试通过 css 或 yaml 包含什么,我仍然会得到相同的 gitbook 结果。

下面我将显示索引文件,然后显示构建的结果。这一切都有效,但它是 gitbook,而不是我所期望的 - 来自更通用的html_book格式。

我对这一切都是新手,但我是一个非常有经验的LaTeX作者,并且非常熟悉css。

但是我在这里遇到了真正的麻烦 - 我的基本目标是渲染衬线字体!这似乎是一场斗争?!

提前感谢您的帮助...

射线

这是简单的索引文件 - 现在通过 jsonformatter 传递...

--- 
title: 'Against the Grain'
author: 'Raymond Brock'
date: '`r Sys.Date()`'
site: 'bookdown::bookdown_site'
'bookdown::html_book': null
output:
html_document:
theme: darkly
highlight: espresso
toc: true
toc_float: true
documentclass: book
bibliography:
- book.bib
- packages.bib
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: 'This is an investgation of two rebels of the 16th century.'
---

然后有多个章节工作正常,只是看起来不像我预期的那样。

但是,结果是构建中显示的常规gitbook。它在哪里被告知要做output_format='bookdown::gitbook'??

生成结果:

==> rmarkdown::render_site(output_format = 'bookdown::gitbook', encoding = 'UTF-8')

processing file: against-the-grain.Rmd
|.................................................................| 100%
inline R code fragments

output file: against-the-grain.knit.md
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS against-the-grain.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output against-the-grain.html --email-obfuscation none --wrap preserve --standalone --section-divs --table-of-contents --toc-depth 3 --template /Library/Frameworks/R.framework/Versions/3.6/Resources/library/bookdown/templates/gitbook.html --highlight-style pygments --number-sections --include-in-header /var/folders/73/fmvtgv_n4f57sjqblbh8439c0000gn/T//Rtmpwmh6tv/rmarkdown-strda8c185d45aa.html --mathjax --filter /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc-citeproc 
Output created: _book/index.html
Warning message:
In split_chapters(output, gitbook_page, number_sections, split_by,  :
You have 7 Rmd input file(s) but only 6 first-level heading(s). Did you forget first-level headings in certain Rmd files?

Gitbook正在从某个地方被调用!我也将 shell 脚本更改为:

#!/bin/sh
set -ev
Rscript -e "bookdown::render_book('index.Rmd')"
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::pdf_book')"
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"

根据文档,可以使用bookdown::html_book作为输出格式,例如

--- 
title: 'Against the Grain'
author: 'Raymond Brock'
date: '`r Sys.Date()`'
site: 'bookdown::bookdown_site'
output:
bookdown::html_book:
theme: darkly
highlight: espresso
toc: true
toc_float: true
description: 'This is an investgation of two rebels of the 16th century.'
---

(为简单起见,我删除了与参考书目相关的内容。

最新更新