figs2tex: Loop through figure files (e.g. pdf) in a folder and generate...

View source: R/figs2tex.R

figs2texR Documentation

Loop through figure files (e.g. pdf) in a folder and generate LaTeX code to make a beamer slide for each figure. This function is developed based on the folder structure generated by the fishgraph package

Description

Loop through figure files (e.g. pdf) in a folder and generate LaTeX code to make a beamer slide for each figure. This function is developed based on the folder structure generated by the fishgraph package

Usage

figs2tex(
  dir1,
  folders,
  dir2 = NULL,
  ext = "pdf",
  label1 = NULL,
  label2 = NULL,
  height = NULL,
  dir_prefix = NULL,
  file_root = NULL,
  hypertargetText = ""
)

Arguments

dir1

directory containing subdirectories (folders) of figures (e.g. spp directory produced by fishgraph)

folders

names of folders of interest within dir1

dir2

optional second directory, analogous to dir1. If provided, the function will generate text code to produce two column slides for comparing analogous figures (e.g. from two runs of the same model)

ext

file extension of figues in subdirectories

label1

text label for slides associated with dir1

label2

text label for slides associated with dir1

height

figure height in cm, passed to the height argument of the latex command includegraphics

dir_prefix

annoying prefix on folder names to be removed with gsub (e.g. figs)

file_root

root names (i.e. without ext) of figures to plot

hypertargetText

Character vector of names for creating hyperlinks in slides (I'll be more specific when I remember what this does!)

Author(s)

Nikolai Klibansky


nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.