From f7dcc4c80282a91490b58878ac641711d944997c Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Tue, 16 Apr 2024 17:49:36 -0400 Subject: [PATCH] Add dedication (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add dedication * add newline at end of index * Revert igraph version * Unified brief dedication * Add dedication * add newline at end of index * Revert igraph version * Unified brief dedication * Capitalize Git Co-authored-by: Isabella Velásquez * Dedicate with emphasis! --------- Co-authored-by: Isabella Velásquez --- .gitignore | 1 + 14-ambarom-vignette.Rmd | 2 +- _output.yml | 2 +- index.Rmd | 20 +++++++++++++++++++ .../{before_body.tex => before_body_temp.tex} | 3 +-- renv.lock | 20 +++++++++++++++++++ 6 files changed, 44 insertions(+), 4 deletions(-) rename latex/{before_body.tex => before_body_temp.tex} (77%) diff --git a/.gitignore b/.gitignore index d74837b6..e16691b7 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ RawData/LAPOP_2021/ # ignore complete NCVS data files due to DUA RawData/NCVS_2021/ICPSR_38429/ osf_dl/*.rds +latex/before_body_ded.tex \ No newline at end of file diff --git a/14-ambarom-vignette.Rmd b/14-ambarom-vignette.Rmd index 848dd734..c8c5bfd0 100644 --- a/14-ambarom-vignette.Rmd +++ b/14-ambarom-vignette.Rmd @@ -315,7 +315,7 @@ covid_educ_ests Finally, to view the results for all countries, we can use the {gt} package to construct Table \@ref(tab:ambarom-covid-ed-der-tab). ```{r} -#| label ambarom-covid-ed-gt +#| label: ambarom-covid-ed-gt covid_educ_ests_gt <- covid_educ_ests %>% gt(rowname_col = "Country") %>% cols_label( diff --git a/_output.yml b/_output.yml index 23336aeb..92151403 100644 --- a/_output.yml +++ b/_output.yml @@ -24,7 +24,7 @@ bookdown::gitbook: bookdown::pdf_book: includes: in_header: latex/preamble.tex - before_body: latex/before_body.tex + before_body: latex/before_body_ded.tex after_body: latex/after_body.tex keep_tex: true dev: "cairo_pdf" diff --git a/index.Rmd b/index.Rmd index 27e0af32..5c2f29c0 100644 --- a/index.Rmd +++ b/index.Rmd @@ -73,3 +73,23 @@ print_gt_book <- function(gtobj, ref){ ``` +`r if (knitr:::is_html_output()) '# Dedication {-}'` + +```{r} +#| label: index-dedication-text +#| echo: false +#| results: asis + +thanks <- "To Will, Tom, and Drew, thanks for all the help with additional chores and plenty of Git consulting!" + +if (knitr:::is_html_output()){ + cat(thanks) +} else if(knitr:::is_latex_output()){ + bb <- readLines(here::here("latex", "before_body_temp.tex")) + bb[which(bb=="placeholder")] <- thanks + writeLines(bb, here::here("latex", "before_body_ded.tex")) + rm(bb) +} + +rm(thanks) +``` diff --git a/latex/before_body.tex b/latex/before_body_temp.tex similarity index 77% rename from latex/before_body.tex rename to latex/before_body_temp.tex index ba63dc7c..e8a54e6f 100644 --- a/latex/before_body.tex +++ b/latex/before_body_temp.tex @@ -6,8 +6,7 @@ \thispagestyle{empty} \begin{center} -placeholder for dedication in latex before body tex -%\includegraphics{images/dedication.pdf} +placeholder \end{center} \setlength{\abovedisplayskip}{-5pt} diff --git a/renv.lock b/renv.lock index f9c70122..287e5eb6 100644 --- a/renv.lock +++ b/renv.lock @@ -987,6 +987,16 @@ ], "Hash": "8b331e659e67d757db0fcc28e689c501" }, + "here": { + "Package": "here", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "rprojroot" + ], + "Hash": "24b224366f9c2e7534d2344d10d59211" + }, "hexbin": { "Package": "hexbin", "Version": "1.28.3", @@ -1830,6 +1840,16 @@ ], "Hash": "0d34b89b43e900467e60f5449226f3e3" }, + "rprojroot": { + "Package": "rprojroot", + "Version": "2.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "4c8415e0ec1e29f3f4f6fc108bef0144" + }, "rstudioapi": { "Package": "rstudioapi", "Version": "0.14",