ismayc / thesisdown

An updated R Markdown thesis template using the bookdown package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with package "babel" [brazil]

AraujoH opened this issue · comments

After following the steps for proper installation of necessary packages and appropriate updates, I tried to knit the index.rmd, but it wouldn't work.

I added options(tinytex.verbose = TRUE) to the code and found out the problem is in the babel package for LaTeX. I checked the coppe.cls file and found %\RequirePackage[english,brazil]{babel}. For reasons I don't understand, probably because I'm relatively new to LaTeX, the line was commented. But even when I un-commented it, the code wouldn't knit.

The error message I get is:

tlmgr search --file --global "/brazil.ldf"
! Package babel Error: Unknown option `brazil'. Either you misspelled it
(babel)                or the language definition file brazil.ldf was not found

Following the directions from the package, I went to https://yihui.org/tinytex/r/#debugging. The first tip is to update the tinytex package, which I did, but this also didn't work. The other tips, to the best of my knowledge, didn't apply to my problem.

I'd like to know if this has been a problem for other users and, if so, I'd like to know how they solved it. Thank you for the help.

Hello. I’m not sure if I’ll be able to help since I don’t have access to the coppe.cls file you mention.

Hey, Chester. I did think I was opening up an issue with the owner of the coppedown package and not you. I'm sorry for the trouble and thank you for getting back to me despite my rather misplaced issue. I'm not sure how this works, but you can close off this issue if you want. Thank you.

No problem, Hugo! I’ll close for you, but please update this on how to fix the error if you figure it out for others.

When I find a way to fix it, I'll certainly share it.

@mralbu Do you happen to know if this issue I reported has happened to more people? I'd appreciate your feedback. Furthermore, if you have dealt with this problem before, please share your solution.

Hi, Araújo! I don't know if this issue has happened to more people (as far as I know you may be coppedown's firt user, besides myself).
I am not a latex expert either, so take my advise with a grain of salt. The coppe latex class seems to use either \RequirePackage[english,brazil]{babel} or \RequirePackage[brazil,english]{babel} for english or portuguese templates (coppe.cls). I tried to solve this problem with variables to selectively insert either statement acordingly (template.tex). It did work for me.
My latex installation may have additional packages besides those installed by tinytex::install_tinytex()
Have you tried installing the portuguese babel latex package? You could try
tlmgr install babel-portuges or sudo apt-get install texlive-lang-portuguese
If you find out how to fix this error, maybe it would be good to point out additional needed steps in the coppedown README file. (pull requests are welcome)

Hey, @mralbu

Thanks for getting back to me on this issue. First I should say I think your efforts to make coppedown out of other packages are laudable.

I just ran tlmgr install babel-portuges and knitted my .rmd file. It all worked like a charm. I did think I needed to have some version of TeX installed in my machine, but apparently I don't.

I think it'd be beneficial to add a few lines in the README file to let users know this error might occur. I think that many people would install tinytex for the first time just so they can knit usinng coppedown. I myself did this; I had never used tinytex before. For this reason, updating a package I'd just installed didn't seem logical.

Another thing I noticed is that when I had to install, sometimes using the canonical install.package wouldn't work, yet the installation would happen just fine if devtools::install_github were used. Do you know why? [This question might not make much sense. I should add I'm not the most experienced R user, especially when things boil down to these types of configuration]

I plan to write my thesis using coppedown and I'll gladly contribute if I come across other problems like this.

tinytex installs a light weight version of TeXLive. Good that installing babel-portuges worked. I've added a command to install it in the README.

# install.packages(c('tinytex', 'rmarkdown'))
tinytex::install_tinytex()
# after restarting RStudio, confirm that you have LaTeX with 
tinytex:::is_tinytex()
# install additional needed latex packages
tinytex::tlmgr_install("babel-portuges")

coppedown is not installable using install.packages because it is not on cran. Currently only github based installation methods are avaiable.

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org whenever possible) and link to this issue. If a reprex is not applicable, recording a short Loom video showing what you are seeing can go a long way in helping to diagnose problems.