save_equations: Systematically save your figures for your report

View source: R/NMFSReports.R

save_equationsR Documentation

Systematically save your figures for your report

Description

Systematically save your figures for your report

Usage

save_equations(
  equation,
  list_equations,
  header = "",
  footnote = "",
  cnt_chapt_content = "001",
  cnt = 1,
  type = "Equation",
  alttext = "",
  nickname = "",
  message = FALSE
)

Arguments

equation

The latex equation you would like to be saved.

list_equations

The list where all equations will be saved.

header

The name and title of the figure. Default = "".

footnote

Any footnote you want attached to this figure.

cnt_chapt_content

The order number that this exists in the chapter.

cnt

The figure number.

type

Default = "Equation", but can be anything that the element needs to be called (e.g., "Eq.", "Equ.") to fit in the phrase "Equation 1. This is my equation!".

alttext

String with what the alternative text is.

nickname

A unique name that can be used to identify the figure so it can be referenced later in the report.

message

TRUE/FALSE. Default = FALSE. If TRUE, it will print information about where your plot has been saved to.

Value

list_equations updated with the new equation and metadata.

Examples

list_equations  <- c()
cnt_eq <- 0

cnt_eq<-NMFSReports::auto_counter(cnt_eq)
list_equations <-NMFSReports::save_equations(
   equation = "$$c^2 = b^2 + a^2$$",
   cnt = cnt_eq,
   list_equations  = list_equations ,
   nickname = "pythagorean",
   header = "Pythagorean theorem",
   footnote = "footnote about how cool the pythagorean theorem is.",
   alttext = "The Pythagoras theorem is a mathematical law.")

cnt_eq<-NMFSReports::auto_counter(cnt_eq)
list_equations <-NMFSReports::save_equations(
   equation = "$$F = G \frac{m_1 m_2}{d^2}$$",
   cnt = cnt_eq,
   list_equations  = list_equations ,
   nickname = "Newton",
   header = "Newton's Universal Law of Gravitation")

names(list_equations )
list_equations

EmilyMarkowitz-NOAA/NMFSReports documentation built on March 26, 2023, 1:08 a.m.