vitae icon indicating copy to clipboard operation
vitae copied to clipboard

Commit f32ca0b causes markdowncv themes to break?

Open monicathieu opened this issue 1 year ago • 6 comments

I updated vitae to 0.6.0 because I was excited to try Colton Baumler's new ccbaumler theme for the markdowncv format. However, my previously rendering CV (using the davewhipp theme) suddenly started to render to a "plain" R Markdown and the theming fails to apply! I haven't changed anything on my CV Rmd.

Also, the following pandoc warnings are now showing up on the Render tab:

[WARNING] Could not fetch resource media/../fonts/academicons.ttf
[WARNING] Could not fetch resource media/davewhippbootstrap-screen.css
[WARNING] Could not fetch resource media/davewhippbootstrap-print.css

This suggests pandoc is failing to find the theme CSS paths, but I sadly don't don't know enough about how vitae calls knitr and pandoc under the hood to know what exactly the issue is.

I have narrowed it down to something in commit f32ca0b, which definitely suggests it's a knitr-to-pandoc issue of some sort. The theme appears correctly when I reinstall vitae on the previous commit (no changes to the Rmd file or anything else).

Annoyingly, the previous commit has that duplication issue the offending commit fixes. I saw some comments in #254 suggesting the duplication was arising from a knitr update, but I checked through several package versions and I actually think it came from the xfun 0.44 update--maybe because xfun::write_utf8() now returns con, not NULL? I did confirm that the theme-less CV knitted after commit f32ca0b does not duplicate the CV contents.

Relevant version info:

R 4.3.1 pandoc 3.1.11 knitr 1.47 (but this issue also happens with 1.43) rmarkdown 2.25

monicathieu avatar Jul 02 '24 02:07 monicathieu

Thanks for the thorough investigation @monicathieu! I'll look into f32ca0b01d6e3e93e0f21152268dd10a28c153ed again, especially with how we might be using xfun::write_utf8().

mitchelloharawild avatar Jul 11 '24 10:07 mitchelloharawild

Hi! Thank you @mitchelloharawild for this super helpful package and @monicathieu for tracking down the error.

I get the same warnings with this setup in Emacs with ESS:

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-apple-darwin20
Running under: macOS Ventura 13.6.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

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

other attached packages:
[1] dplyr_1.1.4    tibble_3.2.1   vitae_0.6.0    rmarkdown_2.27 knitr_1.48    
[6] devtools_2.4.5 usethis_3.0.0 

loaded via a namespace (and not attached):
[1] sass_0.4.9        utf8_1.2.4        generics_0.1.3    stringi_1.8.4    
[5] digest_0.6.36     magrittr_2.0.3    evaluate_0.24.0   pkgload_1.4.0    
[9] fastmap_1.2.0     jsonlite_1.8.8    pkgbuild_1.4.4    sessioninfo_1.2.2
[13] urlchecker_1.0.1  promises_1.3.0    purrr_1.0.2       fansi_1.0.6      
[17] jquerylib_0.1.4   cli_3.6.3         shiny_1.9.1       rlang_1.1.4      
[21] ellipsis_0.3.2    withr_3.0.1       remotes_2.5.0     cachem_1.1.0     
[25] yaml_2.3.10       tools_4.4.0       memoise_2.0.1     httpuv_1.6.15    
[29] vctrs_0.6.5       R6_2.5.1          mime_0.12         lifecycle_1.0.4  
[33] stringr_1.5.1     fs_1.6.4          htmlwidgets_1.6.4 miniUI_0.1.1.1   
[37] pkgconfig_2.0.3   pillar_1.9.0      bslib_0.7.0       later_1.3.2      
[41] glue_1.7.0        profvis_0.3.8     Rcpp_1.0.13       xfun_0.46        
[45] tidyselect_1.2.1  xtable_1.8-4      htmltools_0.5.8.1 compiler_4.4.0   

Please let me know if there's anything I can do to help fix this. I'm not sure why the files for the fonts, etc. aren't located in the expected locations.

LizHareDogs avatar Aug 09 '24 19:08 LizHareDogs

I'm encountering the same program with the kjhealy theme:

[WARNING] Could not fetch resource media/../fonts/academicons.ttf
[WARNING] Could not fetch resource media/kjhealybootstrap-screen.css
[WARNING] Could not fetch resource media/kjhealybootstrap-print.css

What's especially odd is that a search of this repo doesn't even turn up matches for academicons.ttf.

dhicks avatar Jan 09 '25 20:01 dhicks

hello all! I found the problem it is searching for (an example):media/kjhealybootstrap-screen.css when the file it SHOULD be looking for is media/kjhealy-screen.css in the mean time you can just change the name of whatever theme you want in media folder to [theme]bootstrap-screen.css and [theme]bootstrap-print.css

I can't help but wonder if it is from this part of the render command --variable theme=kjhealy --variable csl_list=TRUE --variable theme=bootstrap

tyler-dev333 avatar Apr 15 '25 22:04 tyler-dev333

Double confirming that @tyler-dev333 's band-aid works! I also haven't dug any further at all to see whether that render command is indeed patching the theme name into the expected filename, but if that does end up being the solution, would it break other functionality just to update all of the relevant theme file names?

monicathieu avatar May 26 '25 18:05 monicathieu

您发给我的信件已经收到。 Your message has received,thank you for your mail.You received this email because the recipient set up an auto-response.

heyongcs avatar May 26 '25 18:05 heyongcs