I'm currently working on my thesis and have been using a bookdown template provided by one of the academics in the department but I've run into an issue knitting it to a pdf.
Whenever I try to do so it fails and I get the following error:
! LaTeX socket Error: Sockets can only be declared at top-level!
I have been able to knit the document many times in the past and only came across this issue recently. I was initially able to fix it by removing the tinytex
package and reinstalling it, but this is no longer working and I cannot get the file to knit. The .tex file is created just fine, its in the compiling of the tex file to a pdf that causes the issue. When I attempt to compile the tex file on its own the error is said to be related to the hyperref.sty file used in the compiling, but I genuinely have no idea why or how to fix this.
I have also already tried updating both my R and R studio, and deleting and re-installing LaTeX (LaTeXIT) on my laptop (Macbook Pro if that helps diagnose this issue), but nothing is making any difference. Neither has clearing the cache, nor re-downloading the template and knitting a blank template. I first encountered this issue when I tried to use split
to align my equations, and have had issues since.
Here is the bottom section of the log from when I try to knit if that is of any help:
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
\Hy@SavedSpaceFactor=\count411
! LaTeX socket Error: Sockets can only be declared at top-level!
For immediate help type H <return>.
...
l.2080 {\providecommand\UseSocket[2]{#2}}
Here is how much of TeX's memory you used:
15152 strings out of 476232
276012 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,596b,9378s stack positions out of 10000i,1000n,20000p,200000b,200000s
! ==> Fatal error occurred, no output PDF file produced!
For further background, when this issue happened most recently I removed all of the newly added content from the document and tried to knit it and it still wouldn't knit, even after repeating all the steps I listed above. If anybody could please help that would be greatly appreciated!
.tex
file? – Necessarian