svmiller / svm-r-markdown-templates

This is my (deprecated) suite of R Markdown templates for academic manuscripts, beamer presentations, and syllabi. DOWNLOAD {stevetemplates} INSTEAD.
http://svmiller.com/stevetemplates/
Other
896 stars 737 forks source link

Installation / set-up required for non-acdemic resume? #25

Open brshallo opened 3 years ago

brshallo commented 3 years ago

I am not able to run the example for "Steve's Non-Academic Resume Template." What are the required steps for set-up? I'm running into issues with the fonts, specifically this error:

! Package fontspec Error: The font "Fira Sans" cannot be found.

To get here I opened an Rstudio Cloud instance:

Sys.info()
#>                                               sysname 
#>                                               "Linux" 
#>                                               release 
#>                                      "5.4.0-1037-aws" 
#>                                               version 
#> "#39~18.04.1-Ubuntu SMP Fri Jan 15 02:48:42 UTC 2021" 
#>                                              nodename 
#>       "application-4077019-deployment-10023567-x9h4p" 
#>                                               machine 
#>                                              "x86_64" 
#>                                                 login 
#>                                             "unknown" 
#>                                                  user 
#>                                        "rstudio-user" 
#>                                        effective_user 
#>                                        "rstudio-user"

Then ran:

install.packages("stevetemplates")

tinytex::install_tinytex()
tinytex::tlmgr_install("cochineal")

Then clicked "knit" (resulting in error mentioned above).

I'd also tried tinytex::tlmgr_install("fira") and downloading + installing Fira Sans font but still got stuck at the above error message. (Note that just setting sansfont: cochineal works fine though).

svmiller commented 3 years ago

I'm discovering the wild world of {tinytex} users along the way. I should note that my LaTeX installation is the full texlive suite from Ubuntu, so I'm not able to reproduce this.

A quick Google search results in this possible solution: https://tex.stackexchange.com/questions/421813/xelatex-does-not-find-fira-sans-using-metropolis-theme-beamer. Alternatively, does "FiraSans" or "Fira Sans Regular" work?

brshallo commented 3 years ago

trying to install "FiraSans" or "Fira Sans Regular" did not work, e.g.

> tinytex::tlmgr_install("FiraSans")
tlmgr install FiraSans
tlmgr install: package FiraSans not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (verified)
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr update --self
tlmgr install FiraSans
tlmgr install: package FiraSans not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (verified)
tlmgr: An error has occurred. See above messages. Exiting.

(I had attempted "fira" just because I saw it on ctan -- but just guessing).

What was interesting was that if I open the "filename.tex" (which does get created). And click "compile.pdf" it will compile but jumps a page:

image

(Had thought maybe suggested an issue with Rstudio or default of knit... but doing rmarkdown::render() had brought-up same issues as mentioned originally.)

Perhaps will try with full LaTeX installation or read link you sent a little closer.

statik commented 3 years ago

I used this template last week (thank you for sharing this work Steve! you rock!), and I observed the page break thing happening when I switched to a larger/less compact font, so I think the page break is a normal symptom of the text overflowing, and deleting a line of text fixes it.

For getting a usable latex toolchain, I ended up using a docker image which has all the fonts and stuff preinstalled so that I don't have to deal with latex installations on different machines in different stages of decay. A useful docker image I found was https://github.com/thomasWeise/docker-texlive-full.

In my own use case, I wanted to mix in some RMarkdown and pandoc, and so the actual remixed image that I'm using is here: https://github.com/kindlyops/reporter. With the reporter image, the font name I needed to use was firasans and firacode. Sharing these notes in hope of helping.

svmiller commented 3 years ago

Yeah, that issue happens on my end too if I were to compile by way of .tex rather than R Markdown (the jumping a page).

Even judging from the output, it still looks like it's a case that supplying "Fira Sans" is leading TeX on a rabbit hole where it can't find "Fira Sans". No one ever credibly accused TeX errors of being helpful, but however the Fira Sans font is labelled/installed is not being picked up by TeX and that's kind of what the error (I think) is communicating. FWIW, I've had this happen before in some other things. It's why I was curious if "FiraSans" or "Fira Sans Regular" might be the actual name of the font.