I like to use sumatra PDF viewer as the default viewer.
It doesn’t lock files from editing, hence currently opened files can be changed (e.g. by R).

It comes in Rstudio/resources/app/bin/sumatra and I like to change some settings.

with R

# install.packages("berryFunctions")
# remotes::install_github("brry/berryFunctions") # Version 1.22.1 (2023-11-17)


In C:/Program Files/, set write permissions for the RStudio folder (or at least the sumatra folder, see next step) with rightclick - properties - safety - edit.

Open C:/Program Files/RStudio/resources/app/bin/sumatra/sumatrapdfrestrict.ini and set

  • SavePreferences = 1
  • FullscreenAccess = 1

Open and close a pdf, so that C:/Users/berry/AppData/Roaming/SumatraPDF/SumatraPDF-settings.txt will be created.
There, change the following entries:

  • DefaultZoom = fit page (probably already the default)
  • ShowToc = 0
  • DefaultDisplayMode = single page