As I do not have those files. I also had to add library(jtools) to your list for the theme_apa() function.
This suggests that there is something else in your .Rmd file that is triggering this latex error. I have gotten this error before, but I forget what it was caused by or how I fixed it.
One thing that caught my eye is:
biblio-style: apa-like
I generally just type this as apalike -- something to try for sure, but I don't anticipate this fixing the problem.
Another thing that could cause this problem, is the header-includes part. I generally use:
Rather than omitting the hypens as you have done. I would try this too.
If neither of these solutions fix your problem, I suggest trying to dive into the log file to find which line specifically is causing your problem. You could then paste a more complete .Rmd file that users can reproduce the error from.
Thank you for your help, it got me to dive in to the log file and I finally found the error without really understand it. I just erased the part and built it up from the beginning. Then it worked.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: