[Tex/LaTex] Package not found by TeXstudio after update on Mac

mactex-live-utility

I have just updated to the latest TeXstudio version 2.12.18 on Mac Catalina. Prior to doing so my file was running just fine. Now when I open my TeX file inside TeXstudio majority of \usepackage{} commands are recognised, however some packages are underlined and when hovered over say "Package 'not found'" – specifically xcolor and parskip. When I try to run the file, it stops with the error

File `xcolor.sty' not found. ^^M

I have updated TeX Live to the 2019 version, updated all TeX Live packages to latest versions (the package list actually shows the said 'missing' packages as installed). I also went to TeXstudio preferences and linked the path in "Build Options" to point to TeX Live 2019 folder (/usr/local/texlive/2019/bin/x86_64-darwin). Previously it had 2012, so I updated the path to 2019 just now.

I do not have MiKTeX installed (therefore I expect that TeXstudio should automatically be detected by TeX Live). Checking from terminal: tex --version provides output: TeX 3.14159265 (TeX Live 2019).

Not sure why the packages are showing as missing. I can see online help support, explaining why package is highlighted as missing: https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#texlive but not resolution on what I can do for TeXstudio to find it. The link states that "We determine the tex file database using kpsewhich –show-path ls-R and parse its content." I have run that command in terminal and path for me is: /Library/TinyTeX/texmf-var. I don't really understand if that is the correct pointed location. I would have thought it should point to TeX Live where all my packages are?

I provide an example of the code below which runs, but if you uncomment any of the 2 lines, it will not run:

\documentclass{article}
\usepackage{hyperref}
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
% \usepackage[dvipsnames]{xcolor}
% \usepackage[parfill]{parskip} % Remove paragraph indentation

\begin{document}
First document. This is a simple example, with no 
extra parameters or packages included.
\end{document}

Could someone please shed some light as to how I can run my code?

Best Answer

To anybody struggling with the problem I found the solution (on Mac).

TinyTex is not part of original downloaded distribution of Tex Live (but a replacement option which does not take as much space to download as the main Tex Live version). For me TinyTex was downloaded when running code from my collaborators in RStudio, therefore inadvertently I downloaded this as an R package to my computer. It seems that it was then automatically detected as preferred default by TexStudio.

To resolve the issue: - Uninstall Tiny Tex by deleting it from list of applications. - Restart computer. - TexStudio now automatically sets the path to determine the tex file database to: {/usr/local/texlive/2019/texmf-dist} (checked with this command from Terminal): {kpsewhich --show-path ls-R}

Thank you to everybody who helped out and gave tips, this led me to try various options and find the solution.

Related Question