numprint.sty getting flagged with an undefined control sequence error in tinytex

Hello! I am running a prewritten .Rnw file to learn how to use LaTeX in RStudio. This file has successfully compiled into pdf on my supervisor's computer, so I don't think it's a problem with the script. However, when I try to compile it on my PC, it produces this error message

Line 120 Undefined control sequence

which appears to be in reference to numprint.sty. Clicking on it takes me to line 120 in that file, instead of the script. This appears to just be one of several commands available in the package.

\newcommand*\npnoexponentdigits{\nprt@exponent@fixeddigitsfalse}

Checking the log shows this message

Package caption Info: Begin \AtBeginDocument code. Package caption Info: longtable package is loaded. (c:/Users/clin/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/caption/ltcaption.sty Package: ltcaption 2021/01/08 v1.4c longtable captions (AR) ) Package caption Info: End \AtBeginDocument code.

! Undefined control sequence. l.120 \SweaveOpts {concordance=TRUE} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx), type I and the correct spelling (e.g., ``I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Apologies for the lack of reprex, as I am very new to tinytex & LaTeX in general. It's very possible that the problem is not with the numprint package at all. But I've tried reinstalling tinytex, and updating all my packages as per the tinytex debug guide. I'll try to create an example in the meantime and add it to this thread. Thank you for your patience with a newbie.

[EDIT: It appears that this may be an issue with my RStudio settings. I have my global options set to knitr instead of Sweave. I'll mess around with those and see if it'll fix things.]

Solved the issue! Turned out it was just because I first opened the document before changing my global options to knitr instead of Sweave. Opening a new copy under my current settings fixed all the problems.

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.