/
index.Rmd
118 lines (76 loc) · 2.4 KB
/
index.Rmd
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
# for reference:
# - Mahr: <https://github.com/tjmahr/dissertation/blob/master/index.Rmd>
title: "Do Primaries Work?"
subtitle: "Constituent Ideology and Congressional Nominations"
# title: Bayesian Causal Models of Partisan Ideology and Primary Elections
author: "Michael G. DeCrescenzo"
date: "October 16, 2020"
# `r format(Sys.time(), "%B %d, %Y: %H:%M")`
site: "bookdown::bookdown_site"
github-repo: "mikedecr/dissertation"
# annoying top-level LaTeX control
documentclass: memoir
classoption: oneside
fontsize: 12pt
geometry: "left = 1.25in, right = 1.25in, top = 1.25in, bottom = 1.25in"
bibliography: assets-bookdown/thesis-bib.bib
csl: assets-bookdown/ajps.csl
---
```{r helpers-index, include = FALSE, cache = FALSE}
source(here::here("assets-bookdown", "knitr-helpers.R"))
```
<!-- --- R E N D E R I N G ---
NOTE:
if you move writing into subfolders:
setwd(here::here("writing")); render_*(...); setwd(here::here())
-->
```{r serve-book, eval = FALSE, cache = FALSE, include = FALSE}
# serve
bookdown::serve_book(
dir = here::here(),
output_dir = here::here("_book"),
preview = TRUE,
in_session = TRUE,
quiet = FALSE
)
alarm()
servr::daemon_stop()
# pdf
bookdown::render_book("Index.Rmd", "bookdown::pdf_book"); alarm()
# tufte pdf
bookdown::render_book("Index.Rmd", "bookdown::tufte_book2")
# html
bookdown::render_book("Index.Rmd", "bookdown::html_book")
# preview chapter (live)
# xaringan::inf_mr("30_causality.Rmd")
xaringan::inf_mr("50_voting.rmd")
# preview chapter (static)
bookdown::preview_chapter('40_positioning.Rmd')
# gitbook
bookdown::render_book(
input = "Index.Rmd",
output_format = "bookdown::gitbook"
# , new_session = FALSE # knits IN SESSION
)
```
```{r render-interactive, eval = FALSE, cache = FALSE, include = FALSE}
rmarkdown::render(here::here('020_model.Rmd'))
```
<!------- TO DO ---------
- Fix this git stuff
------------------------->
<!-- git info -->
```{r git-info, include = FALSE, cache = FALSE}
branch_name <- system("git symbolic-ref --short HEAD", intern = TRUE)
commit_hash <- system("git log --pretty=%t", intern = TRUE)[1]
commit_msg <- system("git log --pretty=%s", intern = TRUE)[1]
```
<!-- appears on page 1 if HTML -->
```{block, include = knitr::is_html_output(), cache = FALSE}
Commit ``r commit_hash`` on branch "``r branch_name``":
`r commit_msg`
```
<!------- TO DO ---------
- License / copyright
------------