How to change document language in rmarkdown using latex?

Asked

Viewed 379 times

4

I’m writing a document in Rmarkdown and using Latex for figures and tables. I need the titles of figures and tables in Portuguese, so I tried the following:

Rmarkdown file:

     ---
     Output:
       pdf_document:
           includes:
                 in_header: mystyles.sty
       html_document: rmarkdown :: github_document
       word_document: default
     ---

mystyles.Sty file:

\usepackage[portuguese]{babel}

However, when creating the document using rmarkdown::render("filename.Rmd "), error appears:

! Package babel Error: Unknown option `portuguese'. Either you misspelled it (babel) or the language definition file portuguese.ldf was not found.

As I am on Ubuntu, I:

sudo apt-get install texlive-lang-portuguese

that returns that I already have this package installed:

texlive-lang-portuguese is already the newest version (2015.20160223-1).

I also tried to rotate the sudo apt-get install texlive-lang-european that returns the same

What am I doing wrong here? Because the latex compiler is not recognizing the command?

  • 2

    Do you find the document "English.ldf"? Because the error says it is not possible to find it...

  • 3

    Thanks. That solved my problem. On the terminal, I typed find . -type f -name "*.ldf" who returned a list of files ldf and, among them, the blessed portuges.ldf. I mean, it’s not even portuguese and neither portugues is portugese. Where they got that spelling that’s a mystery

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.