ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
220 stars 81 forks source link

Compilation problems #79

Open JanaMuschinski opened 1 year ago

JanaMuschinski commented 1 year ago

Hello!

I am sure this is not an oxforddown problem, but I can't figure out what is going on and am getting really desperate so would appreciate any help. I can repost on the bookdown page instead if you think that is better. Three months ago, the draft of my thesis compiled without an issue using the oxford down template. Now I am trying to add my next paper to it and nothing works anymore. I can't even get the unmodified oxforddown template to compile if I try to knit the index file.

I have tried updating all packages, updating R, updating RStudio, deleting and reinstalling TinyTex, deleting and reinstalling bookdown and rmarkdown. I have no idea what's going on. My system does compile the basic version of an Rmd file that R creates, so I assume the issue is with bookdown.

I think there are several problems going on, but to start with, if I try to compile let's say chapter 3 of the template, these are the warnings I get.


processing file: 03-rmd-basics-cites-and-refs.Rmd

"C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS 03-rmd-basics-cites-and-refs.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output 03-rmd-basics-cites-and-refs.tex --lua-filter "C:\Users\musch\R\bookdown\rmarkdown\lua\custom-environment.lua" --lua-filter "C:\Users\musch\R\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\musch\R\rmarkdown\rmarkdown\lua\latex-div.lua" --metadata-file "C:\Users\musch\AppData\Local\Temp\RtmpeC9dCq\fileba285e02534" --embed-resources --standalone --table-of-contents --toc-depth 2 --template "templates\template.tex" --number-sections --highlight-style tango --pdf-engine pdflatex --wrap preserve --variable tables=yes --standalone -Mhas-frontmatter=false 
output file: 03-rmd-basics-cites-and-refs.knit.md

tlmgr update --all --self
tlmgr install hyphen-greek
tlmgr.pl: package repository https://anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/texlive/tlnet (not verified: pubkey missing)
tlmgr.pl install: package already present: hyphen-greek
Warning: Package babel Warning: No hyphenation patterns were preloaded for
Warning: (babel)                the language 'greek' into the format.
Warning: (babel)                Please, configure your TeX system to add them and
Warning: (babel)                rebuild the format. Now I will use the patterns
Warning: (babel)                preloaded for \language=0 instead on input line 53.
Warning: Package soulutf8 Warning: This package is obsolete,
Warning: (soulutf8)                use the soul package directly. 
Warning: (soulutf8)                 on input line 29.
Warning: Package minitoc Warning: W0010
Warning: (minitoc)                No file 03-rmd-basics-cites-and-refs.toc. 
Warning: (minitoc)                MINITOCS NOT PREPARED on input line 306.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 4 undefined on input line 483.
Warning: LaTeX Warning: Reference `tab:cars-table' on page 5 undefined on input line 527.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 5 undefined on input line 542.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 5 undefined on input line 542.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 5 undefined on input line 548.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 5 undefined on input line 557.
Warning: LaTeX Warning: Reference `fig:cars-plot' on page 5 undefined on input line 557.
Warning: LaTeX Warning: There were undefined references.

Output created: 03-rmd-basics-cites-and-refs.pdf

If I try to knit the index file, it gives the following warnings. Note that I already have kableExtra version 1.3.4 installed anyways.


processing file: _main.Rmd
  |.                                            |   3% [install_packages]      Failed with error:  '.onLoad failed in loadNamespace() for 'kableExtra', details:
  call: !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output %in% 
  error: 'length = 4' in coercion to 'logical(1)''
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.3/kableExtra_1.3.4.zip'
Content type 'application/zip' length 1852622 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

  |........................                     |  54% [unnamed-chunk-7]       
Quitting from lines 983-988 [unnamed-chunk-7] (_main.Rmd)

Error:
! package or namespace load failed for 'kableExtra':
 .onLoad failed in loadNamespace() for 'kableExtra', details:
  call: !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output %in% 
  error: 'length = 4' in coercion to 'logical(1)'
Backtrace:
 1. base::library(kableExtra)
 2. base::tryCatch(...)
 3. base (local) tryCatchList(expr, classes, parentenv, handlers)
 4. base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 5. value[[3L]](cond)
Execution halted

Other things that are happening that might be related:

Here is my session info:

> sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.utf8  LC_CTYPE=English_United Kingdom.utf8    LC_MONETARY=English_United Kingdom.utf8
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.utf8    

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.3.0  bookdown_0.34   fastmap_1.1.1   cli_3.6.1       htmltools_0.5.5 tools_4.3.0     rstudioapi_0.14 yaml_2.3.7      rmarkdown_2.22 
[10] knitr_1.43      xfun_0.39       digest_0.6.31   rlang_1.1.1     evaluate_0.21  
ulyngs commented 1 year ago

Oh dear!

Can you let me know what error messages you receive when you download a fresh version of oxforddown, then try to knit index.Rmd?

I just tried updating all my own packages etc then knitting index.Rmd and everything seems to work?

ARDeane commented 1 year ago

I've been having the same problem!

I've just downloaded oxforddown, however when I try to knit index.Rmd I get the following error code:

rocessing file: _main.Rmd |. | 3% [install_packages] Failed with error: '.onLoad failed in loadNamespace() for 'kableExtra', details: call: !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output %in% error: 'length = 4' in coercion to 'logical(1)'' trying URL 'http://cran.rstudio.com/src/contrib/kableExtra_1.3.4.tar.gz' Content type 'application/x-gzip' length 1646490 bytes (1.6 MB)

downloaded 1.6 MB

The downloaded source packages are in '/tmp/Rtmp4Jqpfn/downloaded_packages'

Quitting from lines 983-988 [unnamed-chunk-7] (_main.Rmd) Error: ! package or namespace load failed for 'kableExtra': .onLoad failed in loadNamespace() for 'kableExtra', details: call: !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output %in% error: 'length = 4' in coercion to 'logical(1)' Backtrace:

  1. base::library(kableExtra)
  2. base::tryCatch(...)
  3. base (local) tryCatchList(expr, classes, parentenv, handlers)
  4. base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  5. value[3L] Execution halted

Any insight would be greatly appreciated :)

ulyngs commented 1 year ago

Do you still get the error if you install.packages("kableExtra")?

JanaMuschinski commented 5 months ago

Just FYI for anyone in future - I ended up uninstalling and reinstalling everything several times, and in the end somehow managed to get it to work. Unfortuantely not a satisfying answer so apologies to anyone else who ends up having this issue. There were some R packages that I had to manually uninstall by deleting the library folders in my directory and I also had to uninstall and reinstall TinyTex several times through the instructions available on the Bookdown page.

Happy for this to be closed from my POV, depending on whether it should be left open for ARDeane