LatinR / latinr

LatinR package
GNU General Public License v3.0
14 stars 2 forks source link

Error when knitting the .Rmd template - `xelatex` not found #1

Closed beatrizmilz closed 4 years ago

beatrizmilz commented 4 years ago

Hi! I want to write my submission to LatinR 2020. I installed the package {latinr}, and then I created a new rmarkdown file from the template "LatinR Submission Article".

But when I tried to knit the document, I get this error:

Erro: LaTeX failed to compile submission.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Além disso: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  '"xelatex"' not found
Execução interrompida

I looked up on google about this error message, and found this issue.

I tried to reinstall tinytex with tinytex::install_tinytex(), but I still get the error message.

Aparently tinytex is installed:

  tinytex::tinytex_root()
[1] "C:\\Users\\beatr\\AppData\\Roaming\\TinyTeX"

Do I need to install something else to use xelatex??

This is my session info:


> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252    LC_MONETARY=Portuguese_Brazil.1252
[4] LC_NUMERIC=C                       LC_TIME=Portuguese_Brazil.1252    

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

loaded via a namespace (and not attached):
 [1] compiler_3.6.2    htmltools_0.4.0   tools_3.6.2       yaml_2.2.1        Rcpp_1.0.3       
 [6] rmarkdown_2.1     knitr_1.28        xfun_0.12         digest_0.6.24     latinr_0.0.0.9001
[11] rlang_0.4.4       evaluate_0.14    

Thanks :)

eliocamp commented 4 years ago

Hi! Were you able to compile the skeleton document? That is, this RMarkdown?

---
type: oral   #oral, poster, table
language: spanish
title: "Título"
topics: [1, 2]
# Para la lista de tópicos usá latinr::latinr_topics()
authors:
  - first_name: Primer
    last_name: Autor
    email: lncs@springer.com
    country: ar  # lista en latinr::latinr_countries()
    affiliation: "Princeton University"
    url: "google.com"  # Optional 
    corresponding: true
  - first_name: Segundo 
    last_name: Autor
    email: lncs@springer.com
    country: ar
    affiliation: ["Princeton University", "Springer Heidelberg"]
    corresponding: false
speaker: 1  # sólo un autor puede estar como speaker
keywords: 
  - "Mínimo"
  - "tres"
  - "palabras clave"
bibliography: latinr_bibliography.bib
biblio-style: apalike-es   
output: 
    latinr::latinr_article:
      keep_tex: false
params: 
  check_is_error: FALSE
  submission: FALSE
---

```{r submission-checks, echo=FALSE, warning=TRUE}
# Runs some basic checks in metadata. To disable, set check_is_error to FALSE
latinr::latinr_checks(rmarkdown::metadata, params$check_is_error)
knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)

Including Plots

You can also embed plots, for example:

plot(pressure)

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.[@Nuncio2011]

beatrizmilz commented 4 years ago

Hi! Yes, I'm trying to compile this exact Rmarkdown when I get this error!

eliocamp commented 4 years ago

Ah, sorry. I missed that in your original post. Have you tried using

output: 
    latinr::latinr_article:
      keep_tex: false
      latex_engine: pdflatex

as output?

beatrizmilz commented 4 years ago

Just tried it! But got another error.

Erro: LaTeX failed to compile submission.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Execução interrompida

Is it needed to install anything else in the computer in order for it to work? I have MikTex installed

Thank you!

beatrizmilz commented 4 years ago

I'm trying to debug using these debugging tips, so If anything works I'll write here!

eliocamp commented 4 years ago

Ok, then xelatex is not the issue here. I've never used rmarkdown + LaTeX on windows so I don't know exactly how it works. But in any case, tinytex should work!

If you try to compile a pdf from just the normal rmarkdown document, what do you get?

---
title: "Untitled"
author: "Elio Campitelli"
date: "2/24/2020"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)

Including Plots

You can also embed plots, for example:

plot(pressure)

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

beatrizmilz commented 4 years ago

Thanks! For some reason, compiling this code that you posted took some time, but it worked (generated a pdf).. Then I tried again to knit the submission template, and then R started installing some packages related to LaTeX. Exemple:

Trying to automatically install missing LaTeX packages...

It took some time but now works!!

Thank you so much!!

One question: in the footnote it says LATINR 2019. How do I change the footnote to say 2020?

eliocamp commented 4 years ago

That's weird.. 🧐️ But in any case, I'm glad everything's resolved. Thanks for the heads up on the footnote, I'll change it and update it!