R markdown(apa6) pdf knit error

Hi R users,

I've got the following error messages as I knit pdf on my mac. I think I download and update all the packages such as tinytex but it still does not work. Could you guys help me out? Thanks ahead!

query_ctan_mirror: Programs not set up, trying wget
cannot contact mirror.ctan.org, returning a backbone server!

tlmgr: package repository ctan.org/tex-archive/systems/texlive/tlnet (not verified: gpg unavailable)

[1/1, ??:??/??:??] install: apa6 [14k]

fmtutil [ERROR]: format directory not writable: /usr/local/texlive/2020/texmf-var/web2c

! LaTeX Error: File `apa6.cls' not found.

! Emergency stop.
<read *>

Error: LaTeX failed to compile harmony.tex. See See harmony.log for more info.
In addition: Warning messages:
1: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
2: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
3: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
4: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
5: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
6: In chol.default(mat, pivot = TRUE, tol = tol) :
the matrix is either rank-deficient or indefinite
Execution halted

This seems like Latex related error, not R error. Have you try reinstalling the Latex distribution ?

If you are using TinyTeX, with the R package tinytex, you could use tinytex::reinstall_tinytex()

Otherwise, try reinstalling your latex distribution.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.