I'm working with Kile on a Dell Latitude 3540 computer running a Linux CentOS 7 operating system. I'm trying to compile a tex file and I get this error:
File 'todonotes.sty' not found. ^ ^ M
I tried to install it through the command sudo yum install texlive-*
but it did not work.
Any idea on how to install this package?
Best Answer
First, you need to locate where exactly that package is, which you seem to have already done (well, by trying to install the standard bundles). Anyway, this is how you need to formally do it. Running
at some shell prompt gives:
Looks like it is not part of any pre-packaged bundle, so you need to install it manually. You need to find this in CTAN.
Go to the corresponding CTAN page, https://www.ctan.org/pkg/todonotes. The
.zip
file download link is at bottom left. Download this file in some local directory. say, in theDownloads
directory in your home.Go to the corresponding directory, unzip the .zip file (
unzip todonotes.zip
). Move inside the directory todonotes (cd todonotes
).As you can find (
ls -l
) there is no.sty
file there, there is only an.ins
file. In order to generate the.sty
file, run the following command:This generates
todonotes.sty
.Now, we need to put this at some appropriate place. In order to find the suggested location, run:
This is likely to generate something like,
/home/username/texmf
.Following the TeX directory structure, you should place your file in a subdirectory like
~/texmf/tex/latex/
. This has the advantage that it is not necessary to update the package database as TeX searches your personal texmftree directly. See this post for details.So. create a directory
~/texmf/tex/latex/
(mkdir -p ~/texmf/tex/latex/
) and then copy the completetodonotes
directory under it (cp -vr ~/Downloads/todonotes ~/texmf/tex/latex/
).You can then verify which file will be used with:
The above is should show something like:
Now, it you try to use the
todonotes.sty
file inside any LaTeX file, no problem should occur.