-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathNotesToSelf.Rmd
More file actions
86 lines (52 loc) · 2.12 KB
/
NotesToSelf.Rmd
File metadata and controls
86 lines (52 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
## History
- Draft 1: sent to CRC on 15 Nov 2024.
- Final draft: sent
## General
- For caption scaled appropriately for smaller font size (e.g., Exercises), use:
\captionsetup{font={Large,it}}
in appropriate table or figure environment (from the `caption` package)
## Rendering
- To render in R (where `clean = FALSE` keeps the md files (for converting to epub?))
```{r}
bookdown::render_book("index.Rmd", clean = FALSE)
bookdown::render_book("index.Rmd", "bookdown::pdf_book")
bookdown::render_book("index.Rmd"); render_book("index.Rmd", "bookdown::pdf_book")
```
## Publishing
- To publish on gitpages:
- copy al the _books file sinto /docs
- push to githib.
- To publish on bookdown:
```{r}
library(rsconnect)
bookdown::publish_book()
```
(WAS: `publish_book(name="Book"); publish_book()` )
## Defaults
- It seems that figures default to:
- fig.width = 7 (inches)
- fig.height = 5 (inches)
- Now, I can just run `make` which
- creates the PDF file,
- includes using correct LaTeX spacing (at least mostly), such as "RQ.\@ ".
## Initial itemize bullets missing
* The initial bullet goes missing when the example (and prob other similar environments) start with a citation (!).
## Spell check
Use textidote (textidote --output html --check en_UK _main.tex > mainSpell.html)
Run from terminal (from the `_book` directory):
- cd _book
textidote --output html --check en_UK _main.tex > mainSpell.html
- Installed by following: https://formulae.brew.sh/formula/textidote
I used to do this:
- library(spelling)
- spell_check_files("01-Introduction.Rmd", lang="en_GB")
## Misc
- To stash files: git stash -- <filenames>
- To change content of files in a directory:
sed -i '' 's/fig.width=3/fig.width=5/g' *.Rmd
- To locate non-Unicode characters... this seems to (mostly) work...
awk '/[^\x00-\x7F]/ && !(/[\\*$@{.}>",?:\x271=#`]/){print FILENAME":"NR":"$0}' 40-Read.Rmd
- To find a specific character:
awk '/\u0302/' /path/to/your/file.txt
- Thin spaced (e.g., between numbers and units of measurement): This may work:
- TRYING out the weight of `r knitr::asis_output("40\u2009")`m^2^.