post_process_add_alt_text: Add alternative text to figures in the document via the...

View source: R/post-process-add-alt-text.R

post_process_add_alt_textR Documentation

Add alternative text to figures in the document via the pdfmanagement-testphase LaTeX package

Description

Add alternative text to figures in the document via the pdfmanagement-testphase LaTeX package

Usage

post_process_add_alt_text(
  x,
  accessible_pdf = NULL,
  title_page_image = NULL,
  title_page_image_width_cm = NULL,
  figures_dir = NULL,
  knitr_figures_dir = NULL,
  ...
)

Arguments

x

Tex code, as a vector of lines read in from a TeX file by readLines()

accessible_pdf

Logical. If TRUE, inject the code needed to include the 'pdfmanagement-testphase“ package and add alternative text

figures_dir

The subdirectory of the "doc" directory containing images that have previously been made such as pictures and logos, and all other figures made outside the scope of this project

...

Absorbs arguments meant for other functions

Details

Searches the given TEX file for the ⁠includegraphics{}⁠, finds the correct alternative text for those calls by searching through the project RMD files for the matching (ref:variable-alt) definitions and injects the text and the pdfmanagement-testphase structural LaTeX lines for web accessibility

Value

The modified Tex code, as a vector


pacific-hake/hake-assessment documentation built on July 21, 2024, 8:19 a.m.