Knitting Issues

Apple M1/M2

As of August 2023, it seems that there is no version of RStudio built for Apple Silicon Macs (M1/M2). To follow the progress and read some background you might want to check out this blog.

In the meantime, it should work fine to use an Intel-based version of RStudio, through an emulator called Rosetta. You can install Rosetta with the following steps.

  1. Press Command-Space to open Spotlight Search, then enter Terminal.

  2. Click on Terminal to launch the utility.

  3. Copy and paste the following command:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license
  1. Press the Enter key.

TinyTex

Another common issue if you cannot knit the document is that your LaTeX distribution (for example the recommended TinyTeX) has not been properly installed. Go back and see if you got an error message when you tried to install TinyTeX.

One known error is:

The directory /usr/local/bin is not writable.

To fix this error and make the folder writable, you would need to do the following:

  1. Press Command-Space to open Spotlight Search, then enter Terminal.

  2. Click on Terminal to launch the utility.

  3. Copy the following command and paste it into Terminal followed by Enter. (Type your computer password followed by Enter if promted.)

[ -e /usr/local/bin ] || sudo mkdir -p /usr/local/bin
  1. Copy the following command and paste it into Terminal followed by Enter. (Type your computer password followed by Enter if promted.)
sudo chown -R `whoami`:admin /usr/local/bin
  1. Copy the following command and paste it into Terminal followed by Enter. (Type your computer password followed by Enter if promted.)
~/Library/TinyTeX/bin/*/tlmgr path add
  1. Uninstall TinyTeX. In RStudio Console:
tinytex::uninstall_tinytex()
  1. Re-install TinyTeX. In RStudio Console:
tinytex::install_tinytex(force=TRUE)