Remove orphaned figures from a chapter
clean_orphaned_figures.RdRuns audit_chapter() to identify orphaned figures in figure/ and
figure_man/, then deletes them. Figures in attic/ subdirectories
are never deleted.
Arguments
- chapter
Character. Chapter directory name, e.g.
"evaluation".- lecture_dir
Character. Path to the lecture directory. Defaults to
here::here(), i.e. the project root.- lecture
Character. Lecture name for display purposes. Defaults to
basename(lecture_dir).- method
Character. How to detect which figures slides reference:
"auto"(default): Use.flsfiles if they exist for all slides, otherwise fall back to regex. Best for use aftermake slides."regex": Parse.texsource with regex. Fast but can miss dynamically constructed paths (e.g.\\foreachloops)."fls": Parse.flsrecorder files fromlatexmk. More robust but requires prior compilation (make slides). Errors if.flsfiles are missing.
- dry_run
Logical. If
TRUE(default), only list files that would be deleted without actually removing them.