bookdown

R Bookdown - Customize width of TOC/Sidebar

坚强是说给别人听的谎言 提交于 2020-01-01 15:36:46
问题 Although I can change the width and position of different elements in the body of an r bookdown doc by modifying the page wrapper in the .css, is there a way to change the width of the sidebar by modifying the styles sheet? I'm not looking to change the font or color of the words in the TOC, just the width. Something like: width: 50px; margin-right: 0; I don't need a wide sidebar, but I do need more width in the body. I already widened the inner body as much as possible, so all that is left

Create index of definitions / theorems at end of bookdown book

别说谁变了你拦得住时间么 提交于 2020-01-01 05:18:31
问题 For reader convenience, I'd like to include, at the end of my bookdown book, written in markdown, a simple list or index of definitions from the body of the book. i.e. ones created using custom blocks, like this: ```{definition, bar, echo=T} A bar is defined here as a foo-like thing. ``` (My need is for definitions, but others might like lists of theorems, etc. Don't know if lists of figures and tables could be covered in the same way?) Thanks to @yihui I know that knitr::all_labels(engine ==

creating custom blocks in RStudio's bookdown

情到浓时终转凉″ 提交于 2019-12-31 10:47:25
问题 I'm experimenting with the great new package bookdown to create a gitbook-style book using RMarkdown within RStudio. See here. My question is about creating custom blocks. There is an example in the documentation of how to define a block style in a CSS file: div.FOO { font-weight: bold; color: red; } And the authors give some examples of what blocks might look like. AFAIK, there is not an example of how to define this specific block with an icon. I don't know much about CSS, so looking for

Change size of section titles in R Markdown PDF

心不动则不痛 提交于 2019-12-26 02:44:34
问题 Is there a way to change the font size of text of headings in R Markdown? I know how to number the sections of the article; however, in terms of formatting, the font size of the sections that are numbered 1., 2., 3... is too large . As a workaround, I have been using lower-level headers ### Introduction , but these have the wrong numbering. Here is a basic example: --- output: bookdown::pdf_document2 --- # This is too big ### This is the right size but are labelled as 1.0.1 回答1: You can place

Change size of section titles in R Markdown PDF

喜夏-厌秋 提交于 2019-12-26 02:43:09
问题 Is there a way to change the font size of text of headings in R Markdown? I know how to number the sections of the article; however, in terms of formatting, the font size of the sections that are numbered 1., 2., 3... is too large . As a workaround, I have been using lower-level headers ### Introduction , but these have the wrong numbering. Here is a basic example: --- output: bookdown::pdf_document2 --- # This is too big ### This is the right size but are labelled as 1.0.1 回答1: You can place

Special character does not show up in bibliography (but works in body) in bookdown

霸气de小男生 提交于 2019-12-25 03:47:16
问题 I am writing my dissertation with bookdown (https://bookdown.org/yihui/bookdown/) and the memoir class in R. I need to include special characters such as "\oe". This character appears correctly in the body of the document (therefore it's NOT a font problem). However, the same character does not appear in the bibliography section. More precisely, nothing appears instead of the special character. The .bib file is a .tex generated by Zotero where the "\oe" symbol (for instance) is represented as

How do I create a huxtable table caption using bookdown in rmarkdown?

我们两清 提交于 2019-12-24 19:04:05
问题 I have numerous huxtable tables in my rmarkdown. I'd like to caption them using bookdown. So far I've been unable to do this using the bookdown instructions for "other R packages to generate tables" (see URL above). Here's an example which follows the instructions in this answer: --- title: "huxtable-mwe" site: bookdown::bookdown_site output: bookdown::html_book documentclass: book --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(huxtable) library(magrittr) ``` See

How to change the font colour used inside the chunks when building a tufte book using bookdown?

℡╲_俬逩灬. 提交于 2019-12-24 11:27:38
问题 I am trying to build a book, with 9 chapters. I am using the bookdown::bookdown_site package for that, which I have included in the YAML header in index.Rmd. But when I knit the book, using bookdown::tufte_book2, the pdf file generate the text inside the chunks with different font colors. When I try to run each chapter individually, using "tufte_handout", the outcome is as expected. Main text and inside chunk text is monochrome and TimesNewRoman. In rStudio, before build the book, I have

natbib seems to not work properly with pdf_book / rticles

China☆狼群 提交于 2019-12-24 10:57:07
问题 In my .Rmd file, I refer to position in .bib file as follows: "Let me cite an article: [@SampleTitle2016]" When I 'knit the current', I would like to have .tex file where citations to articles are provided by \cite, \citep or \citet command. I noticed that if I omit the line 'citation_package: natbib' in output params, citations are provided as a raw text: However, If add mentioned line, .tex file looks better, but for some reason, bibliography is unable to properly display / (compile?) - I

How to remove diamonded question marks from equations converted from OMML to MathType?

我们两清 提交于 2019-12-24 10:25:03
问题 I have simple bookdown document with labeled LaTeX equation: --- title: "Equation text" output: bookdown::pdf_document2: default bookdown::word_document2: default --- Below is the binom equation \begin{equation} f\left(k\right)=\binom{n}{k}p^k\left(1-p\right)^{n-k} (\#eq:binom) \end{equation} With RStudio it Knits normally to PDF: Also it knits to docx-document and I have OMML equation inside: But for some reason I need to have this equation in MathType form. So I perform its conversion from