detailed_entries() not rendering correctly in R vitae package with custom template

107 views Asked by At

I have created a very basic modification for a custom template as described here. However, when I knit the file mycv_public_mod.Rmd it does not render detailed_entries() correctly; rather it only prints the tibble() as shown in the output file in the linked repository: mycv_public_mod.pdf

This problem does not appear to be occurring for the user who answered the original question (first link above). I am on Ubuntu 22 and running XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2022/dev/Debian)

I updated all of my R packages last night, and am wondering if there is an update that may have broken the functionality. I also ran the following...

sudo R
tinytex::tlmgr_update()

It installed updates in /var/lib/texmf/web2c

Let me know if there are any other versions I should check, or if anyone can replicate this problem/provide a solution.

UPDATE: I have updated to...

  • XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023)
  • RStudio 2023.09.1+494 "Desert Sunflower" Release (cd7011dce393115d3a7c3db799dda4b1c7e88711, 2023-10-16) for Ubuntu Jammy Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2023.09.1+494 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36
  • R 4.3.1

...and the problem persists

1

There are 1 answers

7
Quinton.Quagliano On

Step 1

When I attempt to use rmarkdown::render() on your "mycv_public_mod.Rmd" file without making any changes - I am greeted with the following error:

LaTex Error: File 'awesome-cv.cls' not found

Upon looking into the documentation and vignettes for vitae, I found this article on using templates with vitae. In that article, a line under the heading "Using the Template with Rmarkdown" says the following.

You will also need to copy all of the LaTeX class (.cls) and style (.sty) files provided with the template into the same folder as your rmarkdown document. Once that is done, your new template should be ready to use with the vitae package.

Clearly, I am missing the .cls file that the template must have in order to be used in Rmarkdown. The documentation states that the .cls (and .sty) file(s) would be with the template, so I will start there.

Step 2

I start with a folder with the following files provided via your github - only what is necessary to render the Rmd:

  • apa-single-spaced_mod.csl
  • mycv_public_mod.Rmd
  • mypubs.bib

I use rmarkdown::render() on "mycv_public_mod.Rmd" with the slightly modified following YAML:

---
name: Jessica
surname: Gorzo
position: "Data Scientist"
pronouns: she/her
address: "Cellular Tracking Technologies"
www: avianecologist.com
twitter: setophaga
github: dendroica
linkedin: gorzo
date: "`r format(Sys.time(), '%B %Y')`"
output:
  vitae::awesomecv:
    page_total: TRUE
    keep_tex: TRUE
csl: apa-single-spaced_mod.csl
---

These YAML options will produce a CV using the vitae::awesomecv(). The render succeeds and produces a correctly formatted file:

enter image description here

My folder now contains the following files after rendering:

  • apa-single-spaced_mod.csl (present in og folder)
  • mycv_public_mod.pdf (rendered document)
  • mycv_public_mod.Rmd (present in og folder)
  • mycv_public_mod.tex (new!)
  • mypubs.bib (present in og folder)
  • awesome-cv.cls (new!)
  • fonts/ (new!)

I now have a new .tex file (resulting from the rendering), a .cls file, and a folder of "fonts". I appear to now have what I needed, based on my original error.

Step 3

I return to "mycv_public_mod.Rmd" and set the following YAML:

---
name: Jessica
surname: Gorzo
position: "Data Scientist"
pronouns: she/her
address: "Cellular Tracking Technologies"
www: avianecologist.com
twitter: setophaga
github: dendroica
linkedin: gorzo
date: "`r format(Sys.time(), '%B %Y')`"
output:
  vitae::cv_document:
    latex_engine: xelatex # Specify so it uses this instead of pdflatex
    keep_tex: TRUE # Keep tex file in-between runs
    template: mycv_public_mod.tex # Template that we just made
csl: apa-single-spaced_mod.csl
---

When I run rmarkdown::render() it once again produces a correctly formatted document using the "template" (which is technically just default awesomeCV) I just made. Adding the .cls file from the template creation appears to have worked and I am able to use the vitae::cv_document() function to use a template and create the CV.

enter image description here

Step 4

OP requested the use of a special template to be used that was provided in the github. This time, I will have these files in the folder:

  • awesome-cv.cls (created via the awesomecv() function and rendering)
  • mycv_public_mod.Rmd (from GH)
  • mypubs.bib (from GH)
  • awesome-cv_mod.tex (from GH; modified and desired CV template from OP)
  • apa-single-spaced_mod.csl (from GH)
  • fonts/ (folder created via the awesomecv() function and rendering)

The most important parts here are that I have the "/fonts" folder and the "awesome-cv.cls" that were both generated with the template.

I prepare "mycv_public_mod.Rmd" with the following YAML:

---
name: Jessica
surname: Gorzo
position: "Data Scientist"
pronouns: she/her
address: "Cellular Tracking Technologies"
www: avianecologist.com
twitter: setophaga
github: dendroica
linkedin: gorzo
date: "`r format(Sys.time(), '%B %Y')`"
output:
  vitae::cv_document:
    latex_engine: "xelatex" # Need to specify as dependency of awesomeCV
    template: "awesome-cv_mod.tex" # Modified template provided by OP
csl: apa-single-spaced_mod.csl
---

I use rmarkdown::render() once more, and get the desired result with the template recoloring.

enter image description here