LaTeX failed to compile movie lens

getting the below error while compiling the markdown file into pdf.

output file: movielens.knit.md

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS movielens.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output movielens.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in'
! Undefined control sequence.
l.347 ...by adding the computed (b_{i}) to (\mr
).

Error: LaTeX failed to compile movielens.tex. See The R package tinytex - Helper Functions to Manage TinyTeX, and Compile LaTeX Documents - Yihui Xie | 谢益辉 for debugging tips. See movielens.log for more info.
Execution halted

Hi Skynet, welcome to the forum.

We need a reproducible example (reprex)

Hi,I am adding the Rmarkdown file location on my GitHub.
I am using macOS Monterey.

Please support

I am getting

Quitting from lines 42-58 (movielens.Rmd) 
Error in download.file("http://files.grouplens.org/datasets/movielens/ml-10m.zip",  : 
  download from 'http://files.grouplens.org/datasets/movielens/ml-10m.zip' failed

so I cannot duplicate your problem. Some sample data might help. A simple dput() might do.

It looks like you have a LaTeX problem rather than a strictly R /Rmarkdown problem but I do not know enough about how tinytex and R work to make a guess about where the problem is. At a wild guess, "geometry:margin=1in" looks like your normal weird LaTeX command that requires a latex package not necessarily included in tinytex.

Personally I have no use for tinytex and simply run a full installation of texlive . Trying that might help but it is a real pain to change LaTeX versions.

Sorry to be of so little help.

1 Like

I think this is because \mr is seen as a command and is not found. Hence the issue.

You need to fix this part of your document

1 Like

Hi still getting error.

What is your code in Rmd now ?
Seems like there is still a similar issue but with another command than \mr

hi,
I just replace the mr with mean_rating.

Is \mean_rating a LaTeX math command ? I don't know it. Is it from a package ?

hi, any support.
I am not able to find what is wrong.

Hi,cderv

Please could you support and tell me what is I am doing wrong.
I am able to create *.html output.but while creating *.pdf I am getting the error.

I think I have already told you what is wrong. One of the LaTeX command you use is not found during LaTeX compilation. It does not exists among the loaded package. This is this line:

by adding the computed $b_{i}$ to $\mr$.

This syntax means :

  • I am writing LaTeX Math
  • I am using the \mr LaTeX command.

What is \mr ? From which CTAN package it comes from ? Are you trying to use a LaTeX command here ? Or do you want to do something else ?

Anyway, I said to you before the issue is here, and you did not even answer my last question.

Please next time, take the time to correcty explain what you want to do so that you can get some useful help

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.