0
votes

I'm trying to use the LaTeX package gensymb in my R markdown document (PDF output), but it seems to not work. These two examples work:

IN LaTeX as a .tex file compiled with PDFLaTeX:

\documentclass{article}[12pt]
\usepackage{gensymb}
\begin{document}
It is 90 \degree F outside.
\end{document}

As well as this one In RStudio as a .rmd file using knitr and pdfLaTeX:


header-includes:
output:
  pdf_document:
fontsize: 12pt
geometry: margin=1in
---
It is 90 $^{\circ}$ F outside.

But the following does not compile in a .rmd file.

header-includes:
- \usepackage{gensymb}
output:
  pdf_document:
fontsize: 12pt
geometry: margin=1in
---
It is 90 \degree F outside.

The error from R reports

tlmgr.pl: Local TeX Live (2019) is older than remote repository (2020).
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
See https://tug.org/texlive/upgrade.html for details.
! LaTeX Error: File `gensymb.sty' not found.

Any help is greatly appreciated!

1
Update TeX Live. Got 2 versions of TeX installed? TeX Live/MikTex + tinytex? In the last attempt, tex is clearly trying to find gensymb which is present in your first attempt. Which is weird.Martin Schmelzer
Thanks for the answer! I was not aware that MikTex was installed on this computer in addition to tinytex. This was a clear and useful fix; i really appreciate your response. I don't see a way to endorse your answer, but will try to figure that out ASAP.Rich R

1 Answers

0
votes

The errors suggest that there are two distributions of TeX installed. One of them is not updated to the same version as the repository from which it is trying to get gensymb and therefore fails to download the package. It is wise to only have one distribution installed to prevent errors or confusion like that.