This function deletes auxiliary files generated after compiling LaTeX in the current working directory. Common auxiliary file extensions such as .log, .aux, .out, etc., are removed.

cleanLatex(folder = getwd(), verbose = FALSE)

Arguments

folder

The directory to clean. If not specified, it defaults to the current working directory (getwd()).

verbose

Logical; if TRUE, prints the names of files that are deleted. Default is FALSE.

Value

The function returns TRUE if the files were successfully removed, and FALSE otherwise.

Details

The function automatically removes common temporary files generated during the LaTeX compilation process, including .log, .aux, .out, .bbl, .toc, .bak, and others. It does not prompt the user and will clean the current directory without confirmation.

Examples

if (FALSE) { # \dontrun{
# Clean the current working directory
cleanLatex()

# Clean a specific directory
cleanLatex("/path/to/latex/files", verbose = TRUE)
} # }