elegantbookdown output to pdf

I want to know why i can output html but can not output pdf with elegantbookdown template.

and without elegantbookdown i can output pdf.

and in one situation(project), there is error following

Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: while parsing a quoted scalar at line 2, column 9 found unknown escape character at line 2, column 41
Calls: ... parse_yaml_front_matter -> yaml_load ->

And when i chose annother project, i find it is ok to touch "knit to pdf", but it is just run to html

There is my version

Show in New WindowClear OutputExpand/Collapse Output
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299), RStudio 1.3.959

LC_COLLATE=Chinese (Simplified)_China.936
LC_CTYPE=Chinese (Simplified)_China.936
LC_MONETARY=Chinese (Simplified)_China.936
LC_TIME=Chinese (Simplified)_China.936

Package version:
bookdown_0.28.1 knitr_1.37 rmarkdown_2.12 tinytex_0.37

Pandoc version: 2.9.2

LaTeX version used:
TeX Live 2020 (TinyTeX) with tlmgr 2020-06-01


Hi @fanzheng0352 ,

Will you share the YAML for your project so we can see where it is you're specifying the pdf output?

Here's the YAML example from the bookdown documentation:

documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike

I think also you need to call the pdf_book() function, so your inputs there would also help troubleshoot.

Here's the example of that from bookdown:

pdf_book(toc = TRUE, number_sections = TRUE, fig_caption = TRUE,
  pandoc_args = NULL, ..., base_format = rmarkdown::pdf_document,
  toc_unnumbered = TRUE, toc_appendix = FALSE, toc_bib = FALSE,
  quote_footer = NULL, highlight_bw = FALSE)

And the link to that documentation


Thanks @jonesey441 .

I just used the following template

@fanzheng0352 ,

I see, have you tried selecting the "Build" tab in RStudio, and then selecting "Build All"?

Try that and let me know what output you get.

1 Like

This means something is not correct in the YAML syntax.

You should share you YAML file and headers so that we can help spot it.

1 Like

i found i can not outpu with chinese character and can not use example from yihui.

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
error: LaTeX failed to compile test.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.

and i tach a new post in tinytex: can not output pdf

hope you can help me.
thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.