Hi!
I'm in the middle of writing up my thesis and I am using a bookdown template provided by my university but have run into an issue with knitting the complete document to a pdf.
The error I get when I try to knit is the following:
! LaTeX socket Error: Sockets can only be declared at top-level!
I was originally able to resolve the issue by uninstalling the tinytex package and then reinstalling it, but that isn't working anymore and I can't find a solution elsewhere. The .tex file is created fine, the error occurs as a result of compiling the file to a pdf. When I try and compile the tex file directly the error seems to occur in the hyperred.sty file, but again I have no idea why this error is occurring or how to fix it.
I have already tried updated both R Studio and R itself.
Would really appreciate if someone could help with this!
Here is the bottom section of my log for reference:
\Hy@SavedSpaceFactor=\count411
! LaTeX socket Error: Sockets can only be declared at top-level!
For immediate help type H .
...
l.2080 {\providecommand\UseSocket[2]{#2}}
Here is how much of TeX's memory you used:
15151 strings out of 476232
275852 string characters out of 5795949
1924530 words of memory out of 5000000
36931 multiletter control sequences out of 15000+600000
562584 words of font info for 39 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
81i,0n,95p,542b,9378s stack positions out of 10000i,1000n,20000p,200000b,200000s
! ==> Fatal error occurred, no output PDF file produced!
Yeah I've tried to update LaTeX, as well as uninstalling and reinstalling it, both on my system and in R itself (tinytex package in R). It doesn't make any difference unfortunately.