Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Word templates for 2024 for ResDoc #263

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/resdoc-word.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' template
#' @export
resdoc_word <- function(...) {
file <- if (fr()) "RES2021-fra-content.docx" else "RES2021-eng-content.docx"
file <- if (fr()) "RES2024-fra-content.docx" else "RES2024-eng-content.docx"
base <- word_document2(...,
reference_docx = system.file("csas-docx",
file,
Expand Down
2 changes: 1 addition & 1 deletion R/sr-word.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @rdname csas_docx
#' @export
sr_word <- function(...) {
file <- if (fr()) "SRR-RS2021-fra.docx" else "SRR-RS2021-eng.docx"
file <- if (fr()) "SRR-RS2024-fra.docx" else "SRR-RS2024-eng.docx"
base <- word_document2(...,
reference_docx = system.file("csas-docx",
file,
Expand Down
10 changes: 5 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fr <- function(){
# nocov start
#' Add a Res Doc titlepage to a docx file
#'
#' Add a Res Doc titlepage. Must hand edit `templates/RES2021-eng-titlepage.docx`
#' Add a Res Doc titlepage. Must hand edit `templates/RES2024-eng-titlepage.docx`
#' to have your desired title and authors etc.
#'
#' @param titlepage Filename
Expand All @@ -308,7 +308,7 @@ fr <- function(){
#' @return A merged .docx
#' @importFrom officer read_docx body_add_docx cursor_reach body_add_toc
#' @export
add_resdoc_docx_titlepage <- function(titlepage = "templates/RES2021-eng-titlepage.docx",
add_resdoc_docx_titlepage <- function(titlepage = "templates/RES2024-eng-titlepage.docx",
resdoc = "_book/resdoc-english.docx") {
title_doc <- read_docx(titlepage)
x <- body_add_docx(title_doc, resdoc, pos = "before")
Expand All @@ -318,15 +318,15 @@ add_resdoc_docx_titlepage <- function(titlepage = "templates/RES2021-eng-titlepa
#' Add front matter to Res Doc docx file
#'
#' Add title page and table of contents to a Res Doc. Must hand edit
#' `templates/RES2021-eng-frontmatter.docx`to have your desired title and authors etc.
#' `templates/RES2024-eng-frontmatter.docx`to have your desired title and authors etc.
#'
#' @param frontmatter Path to title page file included with resdoc template
#' @param resdoc Path to content generated using resdoc_word
#'
#' @return A merged .docx
#' @export
add_resdoc_docx_frontmatter <- function(frontmatter = "templates/RES2021-eng-frontmatter.docx",
resdoc = "_book/resdoc.docx") {
add_resdoc_docx_frontmatter <- function(frontmatter = "templates/RES2024-eng-frontmatter.docx",
resdoc = "_book/resdoc-english.docx") {
frontmatter_doc <- read_docx(frontmatter)
x <- body_add_docx(frontmatter_doc, resdoc, pos = "before")
x <- cursor_reach(x, keyword = "TABLE OF CONTENTS")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed inst/csas-docx/RES2021-eng-content.docx
Binary file not shown.
Binary file added inst/csas-docx/RES2024-eng-content.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added inst/csas-docx/RES2024-eng.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading