pzhaonet / bookdownplus Goto Github PK
View Code? Open in Web Editor NEWThe easiest way to use R package bookdown for writing varied types of books and documents
License: MIT License
The easiest way to use R package bookdown for writing varied types of books and documents
License: MIT License
Hello,
when using
bookdownplus::bookdownplus("thesis_ubt")
I get this error
! Class scrreprt Error: undefined old font command
\bf'.`
My system:
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6500 64-bit)
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 backports_1.1.2 magrittr_1.5 bookdown_0.5 rprojroot_1.3-2 htmltools_0.3.6
[7] tools_3.4.2 rstudioapi_0.7 yaml_2.1.16 Rcpp_0.12.14 bookdownplus_1.3.2 stringi_1.1.6
[13] rmarkdown_1.8 knitr_1.18 stringr_1.2.0 digest_0.6.13 evaluate_0.10.1
Here is link: https://github.com/weijianwen/SJTUThesis
There are 3 templates. Thank you.
Hi there!
I'd like to change the main font (it is Times New Roman
, which I have not installed on my openSUSE GNU/Linux system) because I get the error that it is not found. But the change of fonts seems to only have been implemented for mail
. How can I do this? Is it hardcoded in the templates?
Thank you!
Can you show how this will work? Documentation is lacking instruction. I am interested in using skak with the latex package. But bookdownplus doesn't recognize skak even when I install tinylatex.
Hello,
I would like to ask for help to render the article format, now called copernicus
format. I haven't been able to, despite several attempts on different computers. I follow the instructions, by modifying the index script, and running bookdownplus(template = 'article')
. Yet, when I run the latter command, the index and copernicus scripts are automatically updated with the original example content. Then, the output in console is below.
I'd be really grateful for any pointers.
> bookdownplus(template = 'copernicus')
index.Rmd exsits. Backuped to backup/index-2020-03-06-19-44-22.Rmd :)
_bookdown.yml exsits. Backuped to backup/_bookdown-2020-03-06-19-44-22.yml :)
body.Rmd exsits. Backuped to backup/body-2020-03-06-19-44-22.Rmd :)
processing file: copernicus.Rmd
|...................................... | 20%
ordinary text without R code
|............................................................................ | 40%
label: fig1 (with options)
List of 4
$ fig.cap : chr "caption"
$ out.width: chr "80%"
$ fig.align: chr "center"
$ echo : logi FALSE
|.................................................................................................................. | 60%
ordinary text without R code
|........................................................................................................................................................ | 80%
label: tab1 (with options)
List of 2
$ tidy: logi FALSE
$ echo: logi FALSE
|..............................................................................................................................................................................................| 100%
ordinary text without R code
output file: copernicus.knit.md
/usr/local/bin/pandoc +RTS -K512m -RTS copernicus.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output copernicus.tex --table-of-contents --toc-depth 3 --template tex/template_article.tex --number-sections --highlight-style tango --pdf-engine pdflatex --natbib --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/latex-div.lua --wrap preserve --variable tables=yes --standalone
Output created: _book/copernicus.pdf
Warning message:
LaTeX Warning: You have requested document class `style/copernicus-discussions'
,
but the document class provides `copernicus_discussions'.
Package amsmath Warning: Unable to redefine math accent \vec.
Following the instructions in the readme.md for bookscanplus, bd('ubt')
throws an error:
! LaTeX Error: File `scrpage2.sty` not found.
! Emergency stop.
Further investigation reveals package "scrpage2" is obsolete and has been superseded by "scrlayer-scrpage."
Please fix or advise.
I can't create a poster; I get the error in the title using the template provided by bookdownplus
.
> library(bookdownplus)
> bookdownplus(template = "poster")
Then knitting the resulting index.Rmd
file yields:
output file: index.markdown
Traceback (most recent call last):
File "tex/poster-filters.py", line 132, in <module>
doc = pf.walk(doc, filter_structure, format, doc[0]['unMeta'])
KeyError: 0
pandoc: Error running filter tex/poster-filters.py
Filter returned error status 1
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
! I can't find file `index.tex'.
<*> index.tex
(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<*> index.tex
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
I couldn't open file name `index.aux'
Here's my session info.
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] bookdownplus_1.4.2
loaded via a namespace (and not attached):
[1] compiler_3.4.3 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2
[5] htmltools_0.3.6 tools_3.4.3 yaml_2.1.16 Rcpp_0.12.14
[9] stringi_1.1.6 rmarkdown_1.8 knitr_1.18 stringr_1.2.0
[13] digest_0.6.14 evaluate_0.10.1
Hey,
after writing some chapters into the body of my ubt file, I wanted to knit the pdf, but got the following error:
Could not find data file templates\tex\template_ubt.tex
Error: pandoc document conversion failed with error 97
Please delete ubt.Rmd after you finish debugging the error.
Execution halted
I'm not sure, if this is a bug or if I'm doing something wrong.
I'm running bookdownplus with R3.5.2 on Windows 7.
My working directory looks like that:
I tried setting my working directory to "awi" or "ubt" and both didn't work. I also put the "tex" folder into a "template" folder. Copying the template_ubt.tex file into the ubt folder didn't work, too.
Does anyone have any ideas?
Thanks a lot.
Lisa
Hi Peng,
I tried generating a bookdownplus project using template 5 官方中文模板, but it seems not to work on my computer.
Here are my session information, my codes and the error messages:
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdownplus_1.5.5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 compiler_3.5.2 prettyunits_1.0.2 remotes_2.0.2
[5] tools_3.5.2 testthat_2.0.1 digest_0.6.18 packrat_0.5.0
[9] pkgbuild_1.0.2 pkgload_1.0.2 evaluate_0.12 memoise_1.1.0
[13] rlang_0.3.0.1 cli_1.0.1 rstudioapi_0.8 curl_3.2
[17] yaml_2.2.0 xfun_0.4 withr_2.1.2 stringr_1.3.1
[21] knitr_1.21 desc_1.2.0 fs_1.2.6 devtools_2.0.1
[25] rprojroot_1.3-2 glue_1.3.0 R6_2.3.0 processx_3.2.1
[29] rmarkdown_1.11.3 bookdown_0.9 sessioninfo_1.1.1 callr_3.1.1
[33] magrittr_1.5 backports_1.1.3 ps_1.3.0 htmltools_0.3.6
[37] usethis_1.4.0 assertthat_0.2.0 stringi_1.2.4 crayon_1.3.4
> devtools::install_github("pzhaonet/bookdownplus")
> require(bookdownplus)
> bookdownplus(template = template()[5])
template() is to be deprecated. Please use get_template().
processing file: demo_zh.Rmd
|....... | 11%
inline R code fragments
|.............. | 22%
label: unnamed-chunk-1
Quitting from lines 45-46 (demo_zh.Rmd)
Error in dev.control(displaylist = if (record) "enable" else "inhibit") :
dev.control() called without an open graphics device
In addition: Warning message:
In (function (filename = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", :
failed to load cairo DLL
Please delete demo_zh.Rmd after you finish debugging the error.
Any thoughts?
similar to rstudio/rmarkdown#1195
you may refer to pandoc release note to decide how to specify argument according to the version of pandoc on user's OS
模板做的很好,感谢你的辛勤工作!我下载了https://bookdownplus.pzhao.org/portfolio/cumtb_zh/,但是编译成pdf时,报错:
! Undefined control sequence.
@{} >{\raggedright \arraybackslash
}p{(\columnwidth - 4\tabcolsep...
l.235 ...mnwidth - 4\tabcolsep) * \real{0.15}}@{}}
����: LaTeX failed to compile Thesis-Template-Bookdown.tex.
Hi Peng,
Is it possible to specify one or multiple Rmarkdown chapters as preface or acknowledgement before the \mainmatter in bookdown or bookdownplus?
My current solution is to add unnumbered chapters. However, they are still formal chapters with Arabic numerals. But I would prefer them to be Roman numerals before table of contents, list of figures and tables. Here is a snippet of my bookdown pdf output.
I can add preface or acknowledgement in the latex template, but then I will have to write LaTeX syntex instead of concise markdown syntex.
Thanks,
Miao
I updated R, latex and Latexmk to the latest version and also loaded bookdownplus. But the issue is still there:
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS thesis_classic.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_classic.tex --table-of-contents --toc-depth 3 --template tex/template_thesis_classic.tex --number-sections --highlight-style tango --latex-engine pdflatex --natbib --chapters --variable tables=yes --standalone --bibliography bib/bib.bib
output file: thesis_classic.knit.md
Latexmk: This is Latexmk, John Collins, 19 Jan. 2017, version: 4.52c.
Rule 'pdflatex': File changes, etc:
Non-existent destination files:
'thesis_classic.pdf'
------------
Run number 1 of rule 'pdflatex'
------------
Latexmk: applying rule 'pdflatex'...
------------
Running 'pdflatex -halt-on-error -interaction=batchmode -recorder "thesis_classic.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
=== TeX engine is 'pdfTeX'
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
pdflatex: Command for 'pdflatex' gave return code 1
Refer to 'thesis_classic.log' for details
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
! LaTeX Error: \bflabel undefined.
Error: Failed to compile thesis_classic.tex. See thesis_classic.log for more info.
Please delete thesis_classic.Rmd after you finish debugging the error.
Execution halted
Exited with status 1.
My session info:
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdownplus_1.0.2
loaded via a namespace (and not attached):
[1] compiler_3.4.0 backports_1.1.0 bookdown_0.4 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6 tools_3.4.0 yaml_2.1.14
[9] Rcpp_0.12.11 stringi_1.1.5 rmarkdown_1.6 knitr_1.16 stringr_1.2.0 digest_0.6.12 evaluate_0.10.1
I run bookdownplus() in RStudio in win7, the information:
processing file: thesis_classic.Rmd
|............. | 20%
ordinary text without R code
|.......................... | 40%
label: fig1 (with options)
List of 4
$ fig.cap : chr "caption"
$ out.width: chr "80%"
$ fig.align: chr "center"
$ echo : logi FALSE
|....................................... | 60%
ordinary text without R code
|.................................................... | 80%
label: tab1 (with options)
List of 2
$ tidy: logi FALSE
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
output file: thesis_classic.knit.md
"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS thesis_classic.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_classic.tex --table-of-contents --toc-depth 3 --template "tex\template_thesis_classic.tex" --number-sections --highlight-style tango --latex-engine pdflatex --natbib --chapters --variable tables=yes --standalone --bibliography bib/bib
[pandoc.exe warning] --chapters is deprecated. Use --top-level-division=chapter instead.
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6210 64-bit)
entering extended mode
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6210 64-bit)
entering extended mode
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6210 64-bit)
entering extended mode
Output created: _book/thesis_classic.pdf
Warning messages:
1: running command '"pdflatex" -halt-on-error -interaction=batchmode "thesis_classic.tex"' had status 1
2: running command '"pdflatex" -halt-on-error -interaction=batchmode "thesis_classic.tex"' had status 1
3: running command '"pdflatex" -halt-on-error -interaction=batchmode "thesis_classic.tex"' had status 1
run sessionInfo(), the information:
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdownplus_1.3.0
loaded via a namespace (and not attached):
[1] compiler_3.4.1 backports_1.1.0 magrittr_1.5 bookdown_0.4 rprojroot_1.2
[6] htmltools_0.3.6 tools_3.4.1 rstudioapi_0.6 yaml_2.1.14 Rcpp_0.12.12
[11] stringi_1.1.5 rmarkdown_1.6 knitr_1.16 stringr_1.2.0 digest_0.6.12
[16] evaluate_0.10.1
*also, I can't find the .pdf in the _book/ fold, where only available thesis_classic.pdf and thesis_classic.tex.
how do I deal with this issue? thank you so much for your help!
It seems that it can run in R terminal without RStudio. eg.
install.packages(xxx)
library(bookdownplus)
bookdownplus()
I add this command
bookdownplus(template='thesis_mypku_zh')
If can edit in any editor, then make pdf
(similar to this command), it will be better, in my opinion. That is to say, can add a Makefile for this template?
in ./_book, I can see the pku.pdf file. I am so sorry that I can not find where every chapter's Rmd file is. Could you give a better outline template? Thank you.
I am using bookdownplus (development version) in R 3.4.3 (Windows 10)
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdownplus_1.4.3
loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3 yaml_2.1.16
I run in RStudio:
library(bookdownplus)
bookdownplus()
but I do not get the bookdownplus.Rproj, and the *.pdf and _book/ file
Also I do not see the "Build Book" button.
Do you know why?
Best,
Manuel
No real place to leave praise. After wrestling with bookdown/latex to write a book, the latter which I did not want to learn to any great degree as I have much bigger priorities as a budding entrepreneur, this code set facilitates real production level output. Even adding a book cover caused my eyes to bleed in the unenhanced codeset (no disrespect to Yihui at all). Well done, Sir. You are a god among men ;-)
Thanks for the package, looks like a good way to get to grips with bookdown.
However, I am finding some difficulties with initial install.
When I run the following command (I have tried on the latest OS X Rstudio or Ubuntu R console)
bookdownplus::bookdownplus()
I get the following error
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'demo/index_.Rmd': No such file or directory
The current "Copernicus" template does not properly support authors and affiliations. I know it is quite a difficult task (I feel unable to think of a way around this problem). But affiliations should have a number each, and the names of authors the number(s) of these affiliations.
Is there a way to connect them?
P.S.: I find that the main difficulty for me to modify the template is that I do not really know what the syntax is. Is there a name for the sintax in the template?
Having an issue where I run require(bookdownplus) and then bookdownplus() in a blank project and I get all the files except for the bookdownplus.Rproj. Am I doing something wrong?
processing file: thesis_classic.Rmd
|............. | 20%
ordinary text without R code
|.......................... | 40%
label: fig1 (with options)
List of 4
$ fig.cap : chr "caption"
$ out.width: chr "80%"
$ fig.align: chr "center"
$ echo : logi FALSE
|....................................... | 60%
ordinary text without R code
|.................................................... | 80%
label: tab1 (with options)
List of 2
$ tidy: logi FALSE
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
output file: thesis_classic.knit.md
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS thesis_classic.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_classic.tex --table-of-contents --toc-depth 3 --template tex/template_thesis_classic.tex --number-sections --highlight-style tango --latex-engine /Library/TeX/texbin/pdflatex --natbib --chapters --variable tables=yes --standalone --bibliography bib/bib.bib
Latexmk: This is Latexmk, John Collins, 5 Sep. 2016, version: 4.48.
Output created: _book/thesis_classic.pdf
When I try to generate the 19 demo books with the code of 'Magic I' of your book I got the following error messages:
Error: Failed to compile article_zh.tex. See article_zh.log for more info. In addition: Warning messages: 1: In (knit_hooks$get("plot"))(file, reduce_plot_opts(options)) : Chunk options fig.align, out.width, out.height, out.extra are not supported for Word output 2: In file.remove(paste0(template, ".lol")) : cannot remove file 'article.lol', reason 'No such file or directory' 3: In (knit_hooks$get("plot"))(file, reduce_plot_opts(options)) : Chunk options fig.align, out.width, out.height, out.extra are not supported for Word output 4: In file.remove(paste0(template, ".lol")) : cannot remove file 'article_mdpi.lol', reason 'No such file or directory' Please delete article_zh.Rmd after you finish debugging the error.
You will find the article_zh.log here.
On https://github.com/petzi53/test-bookdownplus-2 you can see all the files resulting from the code snippet immediately after installing.
The function bookdownplus()
throws the following error with development version.
devtools::install_github("pzhaonet/bookdownplus")
library(bookdownplus)
bookdownplus()
Error in unzip(paste0(pckpath, "zip/", template, ".zip")) :
invalid zip name argument
Thanks for this package ... I love it!
Playing around with the article template, I fail to identify where and how to change the header on the first pages, i.e. the first 2 lines of the header reading: "Manuscript prepared for J. Name
with version 4.2 of the LATEX class copernicus.cls."
The 3rd line of the header is correctly updated based on the Date in the YAML.
This is the print-out I can produce when building the book.
Thanks for pointing me in the right direction.
With pandoc 2.2.1 and the default bookdownplus(), I get
--chapters has been removed. Use --top-level-division=chapter instead.
Hi, Fantastic work!
I am able to produce every example but the poster one.
Here is the error message:
make: *** No rule to make target 'builddir'. Stop.
processing file: index.Rmd
|....... | 11%
ordinary text without R code
|.............. | 22%
label: packages-and-options (with options)
List of 1
$ cache: logi FALSE
|...................... | 33%
ordinary text without R code
|............................. | 44%
label: co2 (with options)
List of 3
$ cache : logi TRUE
$ echo : logi FALSE
$ fig.cap: chr "Carbon dioxide concentration, observed at Mauna Loa."
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: iris (with options)
List of 3
$ cache : logi TRUE
$ echo : logi FALSE
$ fig.cap: chr "IRIS data plotted with R ggplot2 package."
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: tab1 (with options)
List of 2
$ tidy: logi FALSE
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
output file: index.markdown
make: *** No rule to make target 'pdflatex-index'. Stop.
Warning message:
running command ''make' -s builddir' had status 2
Here is my sessionInfo()
:
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.0 backports_1.1.0 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6
[6] tools_3.4.0 yaml_2.1.14 Rcpp_0.12.11 stringi_1.1.5 rmarkdown_1.6
[11] knitr_1.16 stringr_1.2.0 digest_0.6.12 evaluate_0.10
Any suggestion about this error?
Many Thanks!
Hello,
I'm new to R and markdown and was really glad to see, that it was possible to use templates to get the YAML right. My problem is, that the template defaults to .docx while knitting and I can't find the reason why. Neither in the index.Rmd nor in the body.Rmd did I give the option for rendering to word_document. It's all set to pdf.
In the index:
output:
bookdown::pdf_book:
template: tex/template_ubt.tex
keep_tex: yes
citation_package: natbib
latex_engine: xelatex
toc_depth: 3
toc_unnumbered: no
toc_appendix: yes
pandoc_args: --top-level-division=chapter
quote_footer: ["\begin{flushright}", "\end{flushright}"]
and in the body:
output: pdf_document2: default
The error I get is:
`I was unable to find any missing LaTeX packages from the error log body.log.
! Undefined control sequence.
l.83 \listofsymbols
Error: LaTeX failed to compile body.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See body.log for more info.`
I tried the debugging, so all packages should be up to date and TinyTex is installed and running. The drop down knitting button offers also just the knit to pdf_document2 option, but deliveres a .docx file. I'm quite lost about what is going on.
I tried to load bookdown demos with command bookdownplus( ). But I got an error message:
"Output created: _book/thesis_classic.pdf
Error in tools::file_path_as_absolute(output_file) :
file '_book/thesis_classic.pdf' does not exist
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "thesis_classic.tex"' had status 1
Please delete thesis_classic.Rmd after you finish debugging the error."
I don't know how to proceed.
Hi,
When I try to use the paper_zh
on Mac OS , I meet a problem with YAML.
I use the flowing code to generate the template.
bookdownplus(template = 'paper_zh', to = "chinese_paper", render = FALSE)
,
When I try to produce a pdf document, I find the following erorr:
n*** Successfully loaded .Rprofile ***n Error in yaml::yaml.load(..., eval.expr = TRUE) : Parser error: while parsing a block mapping at line 12, column 3 did not find expected key at line 20, column 4 Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous> Execution halted
By the way, I have changed the YAML setup in the index.md
.
output:
bookdown::pdf_book:
# includes:
# before_body: abstract.tex
keep_tex: yes
dev: "cairo_pdf"
citation_package: natbib
latex_engine: xelatex # for chinese
#template: tex/template_paper_zh.tex
template: tex/template_paper_zh_mac.tex # for macOS #------ I use the tex template for macOS
pandoc_args: --top-level-division=chapter
toc_depth: 3
toc_unnumbered: no
toc_appendix: yes
quote_footer: ["\begin{flushright}", "\end{flushright}"]
documentclass: article
bibliography: [bib/bib.bib]
biblio-style: apalike
link-citations: yes
colorlinks: no
#toc: no
lot: no
lof: no
geometry: [a4paper]
site: bookdown::bookdown_site
#cover-image: images/cover.jpg
I'd like to ask about the available templates. Where can I find a list with all of them? Is there some kind of repository where I can see other people's template and/or upload a new one?
I might create one template I am particularly interested in, but I'd like to see if somebody has done it before, so that I can save the time!
I'm using bookdownplus
R
package with dnd
template. I used the following code.
library('bookdownplus')
bookdownplus('dnd', render = TRUE, rproj = TRUE)
During the compilation of the document, it throws the error:
! Undefined control sequence.
l.61 \hypertarget
{chapter-1-bookdownplus}{%
Error: Failed to compile dnd.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips.
Session Info
sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdownplus_1.5.6
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 bookdown_0.9.2 packrat_0.5.0 digest_0.6.18
[5] magrittr_1.5 evaluate_0.13 stringi_1.4.3 rstudioapi_0.10
[9] rmarkdown_1.12 tools_3.5.3 stringr_1.4.0 tinytex_0.11
[13] xfun_0.6 yaml_2.2.0 compiler_3.5.3 htmltools_0.3.6
[17] knitr_1.22.8
So far, I was able to build a demo for crc
book theme. However, there is something I cannot do: break my book into smaller files. I'd like to have one .Rmd
file for Introduction, one .Rmd
file for Methodology and so on. But I couldn't figure out how to do it. In fact, according to the following quote, I'm afraid I can't do it:
You can see some other files (e.g.
index.Rmd
,body.Rmd
,-bookdownplus.Rproj
) and folders. Write your own texts inbody.Rmd
and revise the author and the book title inindex.Rmd
. You can use RStudio or any other text editor (but please don’t use Microsoft Word).
Is it possible to break my book into smaller files? I mean, more than only two, like the above quote seems to suggest is the only possible way.
Hey all!
So.. I want to write my Bachelorthesis with bookdownplus.
I'm working with R-3.5.1., installed the bookdownpackage version 0.8, bookdown 1.5.2. and tinytex 0.9. and it's Windows 7.
If I run the code
bookdownplus()
I get the following error:
The github repo "pzhaonet/bookdownplus" cannot be connected. Thus only local templates are displayed.
[1] TRUE
Warning message:
In file(file, "rt") :
cannot open file 'd:/github/bookdownplus/upload/-list.csv': Permission denied
There's no book folder in my working directory.
After opening the .Rproj file and clicking on "build" I get the folder and a copernicus. pdf.
Than I ran the following code in that file to create a book with another template (tried it with thesis_ubt, too):
bookdownplus::bookdownplus(template = "thesis_classic", more_output = 'word_document2', title = "Bachelor Thesis", author = "Lisa Bauer", render = FALSE, rproj = TRUE, output_name = "BA")
and got the following error:
The github repo "pzhaonet/bookdownplus" cannot be connected. Thus only local templates are displayed.
thesis_classic is unavailable. Please check whether your spelling is correct. Run get_template() to see available templates.
Warning message:
In file(file, "rt") :
cannot open file 'd:/github/bookdownplus/upload/-list.csv': Permission denied
And if I run the get_template() code as suggested I get the same error like I got with bookdown()
Does anyone have a solution for me?
Thanks a lot!
Hi, in regular rmarkdown environment, we can specify
csl: the-lancet.csl
in the header of the .Rmd file. like this:
---
title: "Sample Document"
output: html_document
bibliography: bibliography.bib
csl: biomed-central.csl
---
How to tweak the similar things in your package?
您好!我使用bookdownplus(template = "article")
命令,但是在当前文件下生成的文件中并未包含bookdownplus.Rproj文件。
我的sessionInfo()
信息为:
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] nlme_3.1-131 pbkrtest_0.4-7 xts_0.9-7
[4] lubridate_1.6.0 devtools_1.13.2 gmodels_2.16.2
[7] httr_1.2.1 rprojroot_1.2 TSA_1.01
[10] rredis_1.7.0 tools_3.4.0 backports_1.1.0
[13] DT_0.2 rgdal_1.2-7 R6_2.2.2
[16] rpart_4.1-11 DBI_0.7 lazyeval_0.2.0
[19] mgcv_1.8-17 colorspace_1.3-2 nnet_7.3-12
[22] withr_1.0.2 sp_1.2-4 mnormt_1.5-5
[25] curl_2.6 compiler_3.4.0 rvest_0.3.2
[28] quantreg_5.33 mice_2.30 SparseM_1.77
[31] xml2_1.1.1 microbenchmark_1.4-2.1 tseries_0.10-41
[34] scales_0.4.1 psych_1.7.5 readr_1.1.1
[37] quadprog_1.5-5 RApiDatetime_0.0.3 stringr_1.2.0
[40] digest_0.6.12 foreign_0.8-68 minqa_1.2.4
[43] rio_0.5.5 base64enc_0.1-3 htmltools_0.3.6
[46] lme4_1.1-13 dbplyr_1.0.0 htmlwidgets_0.8
[49] rlang_0.1.1 readxl_1.0.0 TTR_0.23-1
[52] rstudioapi_0.6 quantmod_0.4-10 sparklyr_0.5.6
[55] shiny_1.0.3 zoo_1.8-0 jsonlite_1.5
[58] gtools_3.5.0 dplyr_0.7.0 ModelMetrics_1.1.0
[61] car_2.1-4 magrittr_1.5 leaps_3.0
[64] Matrix_1.2-10 Rcpp_0.12.11 munsell_0.4.3
[67] stringi_1.1.5 MASS_7.3-47 plyr_1.8.4
[70] grid_3.4.0 parallel_3.4.0 gdata_2.18.0
[73] lattice_0.20-35 haven_1.0.0 splines_3.4.0
[76] hms_0.3 locfit_1.5-9.1 anytime_0.3.0
[79] xgboost_0.6-4 reshape2_1.4.2 codetools_0.2-15
[82] stats4_3.4.0 glue_1.1.0 data.table_1.10.4
[85] nloptr_1.0.4 httpuv_1.3.3 foreach_1.4.3
[88] MatrixModels_0.4-1 cellranger_1.1.0 gtable_0.2.0
[91] purrr_0.2.2.2 tidyr_0.6.3 assertthat_0.2.0
[94] ggplot2_2.2.1.9000 openxlsx_4.0.17 mime_0.5
[97] xtable_1.8-2 broom_0.4.2 bookdownplus_0.0.1
[100] class_7.3-14 survival_2.41-3 wordcloud2_0.2.0
[103] tibble_1.3.3 iterators_1.0.8 memoise_1.1.0
[106] cluster_2.0.6 caret_6.0-76
The following code throws the error: dnd_dev is unavailable
.
library('bookdownplus')
bookdownplus('dnd_dev', render = TRUE, rproj = TRUE)
dnd_dev is unavailable. Please check whether your spelling is correct. Run get_template() to see available templates.
Then I downloaded zip folder from here and tried to compile the document. However, it throws the error:
! Undefined control sequence.
l.61 \hypertarget
{chapter-1-bookdownplus}
Any hints to solve the issue. Thanks
I've tried to build a PDF book :
==> rmarkdown::render_site(output_format = 'bookdown::pdf_book', encoding = 'UTF-8')
But error occurred as blow:
Error in base_format(toc = toc, number_sections = number_sections, fig_caption = fig_caption, :
unused arguments (toc_unnumbered = FALSE, toc_appendix = TRUE, quote_footer = c("\begin{flushright}", "\end{flushright}"))
I don't know how to handle this, is there a possibility that you could give me a hand? Thanks.
Hi @pzhaonet,
Thank you for you fine package which is very useful for people like me with not so much experience!
I am using R version 3.4.2 (2017-09-28) with RStudio Version 1.1.364.
I noticed several installation problems which I would like to report:
So my recommendation is to change your description after the complete installation procedure. The new description should contain the following (new or modified) instructions:
library(bookdownplus)
in the console window (or select the "Packages" Tab in the lower right pane, search for the bookdownplus package and tick its checkmark)ctrl-shift-b
(Windows) or cmd-shift-b
(Mac) for building all formats.Another issue: When you build the book a pandoc warning appears:
[pandoc warning] --chapters is deprecated. Use --top-level-division=chapter instead.
In the long run it would be nice if your package could be default package for the installation procedure in the soon released new version in RStudio. In the preview version, I am using are different choices for creating a new RStudio project. One is to start a bookdown project. It would be nice if Yihui Xie could agree to use your templates for a new bookdown project via RStudio.
Hopefully my comments are of value for you…
PS.: I forgot to mention: With my proposal for a changed instruction you would not need to generate a .Rproj
-file because it is generated by RStudio itself.
I find this script always overwrite my writing.
How can I render with just R or Rscript ?
require('bookdownplus')
outypes=c("word_document2")
bookdownplus(template = 'docsens', render = TRUE, more_output=outypes)
Hi! First of course I would like to thank you for such a contribution like bookdownplus package. It is awesome to work within R to do all the process of publication.
There is a small detail in Elsevier template. You have to hardcode Authors' names, affiliations and email address. So It would be great to have it in the yaml header. I suggest that the yaml file work like this:
- Author:
- Name: AAA
- Afiliation: University XXX
- Email: [email protected]
- Author:
- Name: BBB
- Afiliation: University YYY
- Email: [email protected]
But I do not know how all the
So I would be glad to work on a new template but I clearly need some help on this.
Hello, I cannot figure out how to add page numbers to the classicthesis template?
I see that \pagenumbering{arabic} is there in template_thesis_classic.tex, but there are no page numbers in the compiled document.
stable version of bookdownplus is used in windows10+rstudio+tinytex+missing sty installed
processing file: chemistry.Rmd
output file: chemistry.knit.md
! Paragraph ended before \@cyclohexaneh was complete.
<to be read again>
\par
l.325
Error: Failed to compile chemistry.tex. See chemistry.log for more info.
l.324-l.326 in chemistry.tex
l.324: \cyclohexaneh
l.325:
l.326: {[}bdf{]}\{1==Br;4==Br\} \cyclohexanev {[}A{]}\{1==Br;4==Br\}
I tried to delete the blank line in L325, but it appears again when built, and the same error shows.
Clicking through to the documentation returns an error saying you need to be logged in to RStudio Connect.
The issue "scrpage2.sty not found" seems to be fixed, so far as it goes.
But when I ran "bd('ubt')" LaTeX threw another error: "Environment Shaded undefined."
Also, I made the mistake of trying this in the midst of an ongoing project. It might be a good idea to warn users that when ubt runs, BookdownPlus will make many changes to the existing project. It took me over an hour to track down and change things back to what they were.
系统环境
System: macOS mojave
Latex: tinytex
R: 3.5.3
你好!我使用了您的poem
模板,然后想要加入中文。
我在template_poem.tex
中增加了如下配置:
hello! I have used your poem
template, and wanna insert Chinese into the text
then I edit the template_poem.tex
as follows:
\usepackage{xeCJK}
\usepackage{fontspec}
\setCJKmainfont[BoldFont=FZFYSJW--GB1-0,ItalicFont=FZQKBYSJW--GB1-0]{WenYue-GuDianMingChaoTi-NC-W5}
\setCJKmonofont{FZLTXHK--GBK1-0}
然后编译时会报如下错误:
it crashes like this while compling:
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.115 \end{verbatim}
Error: Failed to compile poem.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See poem.log for more info.
Please delete poem.Rmd after you finish debugging the error.
Execution halted
When I delete the macro package as above and using only English, every thing works well
当删除以上的增加的宏包,并只使用英文时,一切正常。
Hi there!!
First of all, THANK YOU for this package. I have used bookdown before, and just discovered bookdownplus. It seems awesome, I have a lot of ideas to test!
My issue is the following: when running bookdownplus() I get this error
Error in packageVersion("rstudio") : package ‘rstudio’ not found
I am actually running it from Rstudio, so I guess I must have rstudio package...I tried from the "install" in Rstudio but only similar package name is "rstudioapi" which by the way, is already installed.
So I'd like to know where I can install "rstudio" package...or how to solve this!
Despite the error I think all the files are generated, so maybe it is not that bad...
Hello,
I'd like to ask about the possibility of constraining a code chunk inside the designated area. Specifically, in the Copernicus example paper, a code chunk on Page 2 surpasses the right margin into the second column. I've tried to correct this by changing the indentation (in the discussion template in this case, because I can't render the copernicus
format).
I've changed the indentation of the third line from the default one
bookdownplus::
bookdownplus(template = 'article',
more_output = c('html', 'word', 'epub'))
to this,
bookdownplus::
bookdownplus(template = 'article',
more_output = c('html', 'word', 'epub'))
to keep to the space in the copernicus
format paper.
Yet, in the rendered document, the format didn't change. It was still
bookdownplus::
bookdownplus(template = 'article',
more_output = c('html', 'word', 'epub'))
I'd be.really grateful for any advice.
Getting this error when building, using the latest version of pandoc:
output file: thesis_classic.knit.md
--chapters has been removed. Use --top-level-division=chapter instead.
Try pandoc.exe --help for more information.
Error: pandoc document conversion failed with error 2
In addition: Warning message:
running command '"C:/Users/lhailey/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS thesis_classic.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_classic.tex --table-of-contents --toc-depth 3 --template "tex\template_thesis_classic.tex" --number-sections --highlight-style tango --pdf-engine pdflatex --natbib --chapters --variable tables=yes --standalone' had status 2
Please delete thesis_classic.Rmd after you finish debugging the error.
Very excited to find this page. But after installing it and try control+B, it doesn't work as expected. Any insight?
==> rmarkdown::render_site(encoding = 'UTF-8')
|............. | 20%
ordinary text without R code
|.......................... | 40%
label: fig1 (with options)
List of 4
$ fig.cap : chr "caption"
$ out.width: chr "80%"
$ fig.align: chr "center"
$ echo : logi FALSE
processing file: thesis_classic.Rmd
|....................................... | 60%
ordinary text without R code
|.................................................... | 80%
label: tab1 (with options)
List of 2
$ tidy: logi FALSE
$ echo: logi FALSE
|.................................................................| 100%
ordinary text without R code
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS thesis_classic.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output thesis_classic.tex --table-of-contents --toc-depth 3 --template tex/template_thesis_classic.tex --number-sections --highlight-style tango --latex-engine pdflatex --natbib --chapters --variable tables=yes --standalone --bibliography bib/bib.bib
output file: thesis_classic.knit.md
Latexmk: applying rule 'pdflatex'...
Latexmk: This is Latexmk, John Collins, 1 January 2015, version: 4.41.
Rule 'pdflatex': File changes, etc:
Non-existent destination files:
'thesis_classic.pdf'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -halt-on-error -interaction=batchmode -recorder "thesis_classic.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
Latexmk, John Collins, 1 January 2015. Version 4.41
! LaTeX Error: \bflabel undefined.
Error: Failed to compile thesis_classic.tex. See thesis_classic.log for more info.
In addition: Warning message:
Your latexmk version seems to be too low. You may need to update the latexmk package or your LaTeX distribution.
Please delete thesis_classic.Rmd after you finish debugging the error.
Execution halted
Exited with status 1.
My sessioninfo:
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] backports_1.1.0 bookdown_0.4 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6 tools_3.3.2 yaml_2.1.14 Rcpp_0.12.11
[9] stringi_1.1.5 rmarkdown_1.6 knitr_1.16 stringr_1.2.0 digest_0.6.12 evaluate_0.10.1
>
After following the instructions in the github site:
bookdownplus(template = 'ubt', render = TRUE)
I got the following error:
output file: ubt.knit.md
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS ubt.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output ubt.tex --table-of-contents --toc-depth 3 --template "tex\template_ubt.tex" --number-sections --highlight-style tango --pdf-engine pdflatex --natbib --wrap preserve --top-level-division=chapter --variable tables=yes --standalone
tlmgr search --file --global "/scrreprt.cls"
! LaTeX Error: File `scrreprt.cls' not found.
! Emergency stop.
<read *>
Error: Failed to compile ubt.tex. See ubt.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
Failed to find a package that contains scrreprt.cls
Please delete ubt.Rmd after you finish debugging the error.
Hi , I'm testing bookdownplus in Win 10 traditional Chinese version.
Basically, all the Chinese templates are successfully compiled after the required font files were installed.
Because my computer processed Chinese font in UTF-8, there are many warnings "Failed to convert input string to UTF16" returned to me. Although bookdownplus could render the rmarkdown with traditional Chinese, I'm wondering there is the solution to remove these warnings.
By the way, is it possible the users could use the customed font?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.