@@ -9,6 +9,7 @@ library(jsonlite)
9
9
# however, they do not allow to keep the labels that the bib items already have.
10
10
11
11
drive_auth()
12
+ 2
12
13
13
14
# download the docx files from google drive
14
15
folder <- " https://drive.google.com/drive/folders/10cZDtfWFMglGF4ICvBzv6HXkfsqT3eP1"
@@ -59,13 +60,21 @@ for (hoofdstuk in c("zilt", "kustduin", "water", "heide", "gras", "veen",
59
60
paragrafen [! (paragrafen %in% rmd $ sec_h1 )],
60
61
collapse = " , " )))
61
62
for (x in paragrafen ) {
62
- rmd_select(rmd , by_section(x )) %> %
63
+ txt <- rmd_select(rmd , by_section(x )) %> %
63
64
rmd_select(has_type(" rmd_markdown" )) %> % # do not print the headers, only the text
64
- as_document() %> %
65
+ as_document()
66
+ txt <- txt %> %
65
67
str_replace_all(fixed(" \\ @" ), " @" ) %> %
68
+ str_replace_all(fixed(" \\ *" ), " *" ) %> %
69
+ str_replace_all(fixed(" \\ [!ht\\ ]" ), " [!ht]" ) %> %
66
70
str_replace_all(fixed(" \\ [@" ), regex(" [@" )) %> %
67
71
str_replace_all(" \\\\ ]" , " ]" ) %> %
68
72
str_replace_all(" \\ {.mark\\ }" , " " ) %> %# this text appears when the text background is not white in the docx
73
+ str_replace_all(" \\\\ ~" , " ~" ) %> %
74
+ str_replace_all(" \\\\ `" , " `" ) %> %
75
+ str_replace_all(fixed(" \\ |" ), " |" ) %> %
76
+ str_replace_all(fixed(" \\\\ " ), " \\ " )
77
+ txt %> %
69
78
writeLines(useBytes = TRUE ,
70
79
con = find_root_file(" source/bookdown/habitatauteurs_paragrafen" ,
71
80
sprintf(" %s_%s.md" ,hoofdstuk ,x ),
0 commit comments