getFigurePathsFromTex() reads \includegraphics{} entries from a TeX file. getTablePathsFromTex() reads \input{} entries and adds a .tex extension when the TeX input omits it. Commented-out entries are ignored.

getFigurePathsFromTex(.file, .report_dir = NULL)

getTablePathsFromTex(.file, .report_dir = NULL)

Arguments

.file

TeX file to parse.

.report_dir

Directory that relative TeX paths should be resolved from. Defaults to the parent of a sections directory when .file is in one, otherwise dirname(.file).

Value

Character vector of normalized paths relative to the current working directory when possible, otherwise relative to here::here().

Examples

if (FALSE) { # \dontrun{
  getFigurePathsFromTex(here::here("deliv/report/sections/figures.tex"))
  getTablePathsFromTex(here::here("deliv/report/sections/tables.tex"))
} # }