bookdown

bookdown Error 'CTeX fontset `mac' is unavailable in current mode.' when using output format pdf_book & pdf_document2

纵然是瞬间 提交于 2019-12-11 02:44:24
问题 I'm using bookdown with Rstudio + tinyTex + pandoc to write a report in Chinese. Because I need to use cross reference, I have to set the output format to pdf_document2, but I got an issue about CTeX fontest. First, here is the YAML part: --- title: "title" author: - author documentclass: ctexart site: bookdown::bookdown_site output: bookdown::pdf_document2 bibliography: bib_v1.bib csl: chinese-author-date.csl link-citations: yes colorlinks: yes classoption: "hyperref," --- And there's some

Code folding in bookdown

 ̄綄美尐妖づ 提交于 2019-12-11 02:08:48
问题 The Code folding option in RMarkdown for html documents is awesome. That option makes the programmatic methodology transparent for those who are interested, without forcing the audience to scroll through miles of code. The tight placement of code with prose and interactive graphical output makes the whole project more accessible to a wider audience, and furthermore it reduces the need for additional documentation. For a larger project, I'm using bookdown, and it works great. The only problem

Customize or remove the header of reference after specify csl on Bookdown

心已入冬 提交于 2019-12-11 00:35:50
问题 I specified a csl bibliography style as described by this method of bookdown Chinese example, and found the header for the Reference was incorrect, it should be "参考文献(Reference) instead of "附录(Appendix)" for the second page of Section Reference. How can I customize it to 'Reference' or just remove it. 回答1: You can use the LaTeX command \markboth{left page}{right page} to set the page headings, i.e. something like this # 参考文献 {#references .unnumbered} \markboth{参考文献}{参考文献} ```{r include=FALSE}

Input .tex in Rmarkdown

♀尐吖头ヾ 提交于 2019-12-10 21:05:52
问题 I'm using Rmarkdown/Bookdown to write a paper/PDF document, which is an amazing tool @Yihui, thanks! Now I'm trying to include a table I have already put in LaTeX into the document by reading in this external .tex file. However, when knitting in RStudio with a \include{some-file.tex} or input{some-file.tex} in the body of the .Rmd outside of a chunk a LaTeX Error: Can be used only in preamble. is produced and the process stopped. I haven't found a way how to directly input through knit or

knitr/rmarkdown/Latex: How to cross-reference figures and tables in 2 different pdf files?

别等时光非礼了梦想. 提交于 2019-12-10 19:49:13
问题 I'm trying to write a scientific article and the associated supplementary materials entirely in RStudio with rmarkdown. It seems clear that book down is the way to go to cross-reference between files (https://stackoverflow.com/a/38884378/576684), but I also would like to be able to reference figures produced in one pdf in the other pdf. Although my latex has got quite rusty with time, I imagine it could be achieved as follows: compile the article tex and SuppMat tex a first time using

Bookdown: Set Page Breaks

半世苍凉 提交于 2019-12-10 06:10:35
问题 I cannot find out how to make a page break in R bookdown. With page break I mean that the content within one page is displayed as one website. By default there is always a page break in front of every new section (like # Chapter 1 ). So, if I run render_book each section becomes one html file. But, if I have a lot of subsections then these sites get very long. I would like to have page breaks before every subsection (like ## Chapter 1.1 ). So far I tried adding \newpage , \pagebreak , -------

Referencing a 'hand-made' table using bookdown package

浪尽此生 提交于 2019-12-09 14:36:33
问题 I'm trying to reference a table using the bookdown package. In the documentation for tables, the author only shows how to create tables using knitr::kable . ```{r table1} knitr::kable( head(iris, 20), caption = 'Here is a nice table!', booktabs = TRUE ) ``` Table \@ref(tab:table1) is here. Using knitr::kable works just fine. The caption of the table is displayed and I can reference the table. I would like to do the same with a classic, hand-made markdown table, but obviously the code below

Bookdown text references not working if URL contains special characters

[亡魂溺海] 提交于 2019-12-08 07:52:54
问题 There is some inconsistent behaviour of text references in bookdown with URLs containing special characters such as : or _ . Here are some demonstrations: --- output: bookdown::pdf_book --- (ref:good) [This Works](https://commons.wikimedia.org/wiki) (ref:good) (ref:bad) [This Does Not](https://commons.wikimedia.org/wiki/File:Linear_visible_spectrum.svg) (ref:bad) The link will work normally [like here](https://commons.wikimedia.org/wiki/File:Linear_visible_spectrum.svg) Is there a way to get

knitr::include_graphics in bookdown, is not rendering the image

百般思念 提交于 2019-12-08 07:34:06
问题 I am trying to include a .png file in a file that I am rendering using bookdown. knitr::include_graphics() should be the way to go. The code: ```{r fig1, fig.cap='My Caption', echo=FALSE, message=FALSE, warning=FALSE} knitr::include_graphics("./Figures/My Figure.png") ``` In the .Rmd file, I can run my r block, and it renders the image below. So, the path should be correct. However, when I knit the chapter, or render the entire book, the figure is not rendered. Could it be that some of my

Change figure and table captions in blogdown

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 12:16:16
问题 I'm tinkering with blogdown and would like to create figures and table with non-English caption headers. The following chunk ```{r label1, echo=FALSE, fig.cap="Fancy caption", fig.fullwidth=TRUE} plot(1,1) ``` produces the plot and a caption that reads Figure 1: Fancy caption I'd like to be able to change the label such that, say, "Figure" becomes "Plot". I thought I could fix it in the same way as for bookdown : In the _bookdown.yml file I could have language: ui: chapter_name: "Chap "