rr-france/bookrr

Make pdf fails

Closed this issue · 3 comments

There seems to be a problem with a mandatory? font: Alegreya-Regular
or the need to have superuser privileges to run tlmgr

ln -sf index.md index.Rmd
ln -sf 09_collecte_des_donnees.md 09_collecte_des_donnees.Rmd
ln -sf 22_quatrieme_de_couv.md 22_quatrieme_de_couv.Rmd
ln -sf 10_format_des_donnees.md 10_format_des_donnees.Rmd
ln -sf 19_annexes.md 19_annexes.Rmd
ln -sf 13_apprendre_a_programmer.md 13_apprendre_a_programmer.Rmd
ln -sf 18_biblio.md 18_biblio.Rmd
ln -sf 11_partage_et_archivage.md 11_partage_et_archivage.Rmd
ln -sf 21_auteurs.md 21_auteurs.Rmd
ln -sf 04_acquisition_des_donnees.md 04_acquisition_des_donnees.Rmd
ln -sf 12_outils_de_gestion_de_version.md 12_outils_de_gestion_de_version.Rmd
ln -sf 02_vis_ma_vie.md 02_vis_ma_vie.Rmd
ln -sf 15_eviter_les_bugs.md 15_eviter_les_bugs.Rmd
ln -sf 06_aspects_computationnels.md 06_aspects_computationnels.Rmd
ln -sf 17_licence_et_privacy.md 17_licence_et_privacy.Rmd
ln -sf 01_RR_kezako.md 01_RR_kezako.Rmd
ln -sf 08_introduction_partie_3.md 08_introduction_partie_3.Rmd
ln -sf 16_environnement_logiciel.md 16_environnement_logiciel.Rmd
ln -sf 05_donnees_d_entree.md 05_donnees_d_entree.Rmd
ln -sf 07_donnees_de_sortie.md 07_donnees_de_sortie.Rmd
ln -sf 03_questions_cauchemars_recurrents.md 03_questions_cauchemars_recurrents.Rmd
ln -sf 14_rendre_son_code_comprehensible.md 14_rendre_son_code_comprehensible.Rmd
ln -sf 00_preambule.md 00_preambule.Rmd

switch PATH to call latex/xelatex instead of plain xelatex

so that we can fix the tex file (see the next target)

env SAVEDPATH="$PATH" PATH="latex:$PATH"
Rscript -e "rmarkdown::render_site(output_format = 'bookdown::pdf_book', encoding = 'UTF-8')"

processing file: booksprintrr.Rmd
|.................................................................| 100%
inline R code fragments

output file: booksprintrr.knit.md

/usr/bin/pandoc +RTS -K512m -RTS booksprintrr.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output booksprintrr.tex --table-of-contents --toc-depth 2 --template /home/pernot/R/library/3.2/rmarkdown/rmd/latex/default-1.17.0.2.tex --number-sections --highlight-style tango --latex-engine xelatex --natbib --include-in-header latex/preamble.tex --include-before-body latex/before_body.tex --include-after-body latex/after_body.tex --variable graphics=yes --variable 'geometry:margin=1in' --variable 'compact-title:yes' --variable tables=yes --standalone
tlmgr search --file --global '/Alegreya-Regular.'
Cannot determine type of tlpdb from /home/pernot/texmf!
cannot setup TLPDB in /home/pernot/texmf at /usr/bin/tlmgr line 5713.
! fontspec error: "font-not-found"
!
! The font "Alegreya-Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H .
!...............................................

!
! The font "Alegreya-Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H .
!...............................................

! The font "Alegreya-Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H .
!...............................................

!
! See the fontspec documentation for further information.
!
! For immediate help type H .
!...............................................

! See the fontspec documentation for further information.
!
! For immediate help type H .
!...............................................

!
! For immediate help type H .
!...............................................

! For immediate help type H .
!...............................................

Erreur : Failed to compile booksprintrr.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See booksprintrr.log for more info.
De plus : Warning messages:
1: l'exécution de la commande ''tlmgr' search --file --global '/Alegreya-Regular.'' renvoie un statut 2
2: In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
Failed to find a package that contains Alegreya-Regular.
Exécution arrêtée
Error in render_book_script(output_format, envir, quiet) :
Error 1 attempting to render book
Calls: -> -> in_dir -> render_book_script
Exécution arrêtée
Makefile:28 : la recette pour la cible « pdf » a échouée
make: *** [pdf] Erreur 1

Solved by [re]installing TinyTex

install.packages('tinytex')
tinytex::install_tinytex()

Should this figure in the Install instructions ???

Yes, this would be nice. Please mention this option in the documentation.