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:

\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

First document. This is a simple example, with no 
extra parameters or packages included.

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

  • 1
    your document will run in an up to date installation, if you are getting an error that xcolor is not found then presumably you do nt have it installed and tlmgr install xcolor (or sudo tlmgr install xcolor) should install it. – David Carlisle Jan 10 at 1:13
  • before checking if it works from texstudio, does it work if you simply type pdflatex yourfilename.tex in a terminal after changing directory to the folder with the file? – David Carlisle Jan 10 at 1:15
  • Thank you very much, RESOLVED. Firstly thank you so much for your help. I tried to run the sudo command first, and was told to update tlmgr, so I ran: tlmgr update --self. Following this I ran the sudo commands on both packages and now the tex file runs! Could you please explain where the packages where installed to? I do not understand why and where they were 'missing' from, if the Tex Live was showing them as installed? I read that TexStudio automatically detects Tex Live and thus I expected for it to find all installed packages there. Also everything was ok until update, so why? – Katya Jan 10 at 1:51
  • I have now moved onto editing my paper and the following missing package 'mathpazo' is not resolved using your suggestion unfortunately. When I try to install with the commands, the message I get back is that it is already installed. But when I run the file I get the following error: File `mathpazo.sty' not found. \RequirePackage. I would also really like for these packages to be installed automatically. Equally the TexStudio still underlines them as missing (even the ones that were now working - I know this can happen but would be nice to resolve in a centralised manner). Any suggestions pls? – Katya Jan 10 at 3:30
  • 1
    Why are you using TinyTeX? then you have to install a lot by hand. Why not just installing MacTeX, that is the fastest way to install the full texlive on a MacTeX (granted it has to be updated after installation). – daleif Jan 10 at 9:27

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.