Skip to contents

Add New Section to Template

Usage

add_section(
  sec_names = NULL,
  location = NULL,
  other_sections = NULL,
  subdir = NULL
)

Arguments

sec_names

section_names of the subsection. Please keep this short as the template will be created as a quarto document into your skeleton and saved later for reference. More than one section can be added. Please make a list if this is desired.

location

Where the section will be added in the generic template using the notation of 'placement-section'. Example would be 'in-introduction' where the new content would be created as a child document and added into the 02_introduction.qmd. There is an option to add more than one section. Add the location as a list corresponding to the order of section names listed in the 'title' parameter

other_sections

List of other sections that the added sections will be combined with (if not NULL)

subdir

directory where the new sections will be saved - in the create_template fxn this defaults to the location where the template is saved

Value

Add an additional section to the report template if it is not already in the default template. This provides the option to adding it as a subsection either before or after it or within the subsection itself as a child document.

Examples

add_section(
  sec_names = "Ecosystem Considerations", location = "after-discussion",
  other_sections = c("introduction.qmd", "model.qmd", "results.qmd", "discussion.qmd"),
  subdir = tempdir()
)
#> [1] "introduction.qmd"             "model.qmd"                   
#> [3] "results.qmd"                  "discussion.qmd"              
#> [5] "Ecosystem_Considerations.qmd"