Set or reset the Overleaf project location

set_overleaf_project(project = NULL)

Arguments

project

Either a project name fragment (like "Orange Book"), a full project name (like "Orange-Book-2025"), or a full file path to an Overleaf project folder. If NULL (the default), you will be prompted to select from available projects.

Value

The full path to the selected Overleaf project folder, invisibly.

Details

This function lets you choose which Overleaf project to save charts to when using grattan_save_overleaf(). The setting is stored as an environment variable for the current R session only.

If you don't provide a project, you'll see a menu of available Overleaf projects to choose from. If you provide a project name or fragment, it will search for matching projects (case-insensitive). If you provide a full file path, it will use that path directly.

Since this setting only persists for the current R session, we recommend calling set_overleaf_project() at the beginning of your script, or in a project setup script or .Renv file, to improve reproducibility.

Examples

if (FALSE) { # \dontrun{
# Prompt to select from available projects
set_overleaf_project()

# Search for a project by name fragment
set_overleaf_project("Orange")  # Finds "Orange-Book-2025"

# Use exact project name
set_overleaf_project("Orange-Book-2025")

# Manually set a specific project path
set_overleaf_project("/Users/you/Dropbox/yourname/Apps/Overleaf/My Report")

# Call at the start of your script for reproducibility
set_overleaf_project("transport-report")
# ... rest of your script
} # }