Installing latex packages

Issues related to applications and software problems
Post Reply
astronasrin
Posts: 4
Joined: 2016/11/18 18:42:21

Installing latex packages

Post by astronasrin » 2016/11/18 18:53:00

I am very new to Centos. I am using Centos 7. So I installed Texlive and using texmaker for compiling my document. It cannot find a lot of packages and I am having a hard time to install all the new packages. I tried to find and install a latex package manager. From my search I found something called tlmgr but seems that there is no Centos version of it available. What is the best way to install new packages without having to install them one by one? And if there is no systematic way of doing it how should I install a package manually?

owl102
Posts: 334
Joined: 2014/06/10 19:13:41

Re: Installing latex packages

Post by owl102 » 2016/11/19 09:11:37

astronasrin wrote:So I installed Texlive
How did you install texlive?

I (as a LaTeX package maintainer) strongly recommend not using the version from the repository but using the version from TUG instead:

https://www.tug.org/texlive/quickinstall.html

(Prerequisites for CentOS 7: yum install perl-Tk perl-Digest-MD5 )

Yes, I recommend not using the CentOS repository here, which is clearly an exception since usually it's a very bad idea not using the repository. Why I do this:

- The version from the repository is outdated. When it comes to LaTeX this can lead to problems: First of all package maintainers usually only support the recent version. And when asking questions on https://tex.stackexchange.com/ they recommend to update your TeXlive first, but you cannot using the version from repository. When installing LaTeX packages manually you can get easily into dependency hell - The recent version of the package you try to install does not work with older versions of other packages, so you get strange error messages. If you install updated versions of LaTeX packages manually to solve this issue, they depend on newer versions of other packages as well, and so on... In the end you lost 2 days just for updating half of the packages manually and resolving all the issues caused by incompatible versions of LaTeX packages.

- There are some LaTeX packages missing when using the repository version.

- You get no tlmgr for installing/removing/updating TeX packages.

- TeXlive is a TeX distribution which uses a mixture of "stable release" and "rolling release" paradigms.The core components (for example TeX itself) has been tested by the TeXlive team, but very nearly everything else and especially all the LaTeX packages are just the very recent version. So the version of TeXlive in the CentOS repository is not a very good or stable or tested version. It's just a snapshot of a rolling release TeX distribution which was done when TeXlive was packaged for CentOS. So in this case you get no benefit in using the version from the CentOS repository, just the opposite.
I am having a hard time to install all the new packages.
Unfortunately the procedure for installing LaTeX package is not always the same. There is a recommended way but not all package maintainers follow this route. Usually there is a file with the extension ".ins" (e.g. packagename.ins), compiling this file with TeX will extract the package and will print a small instruction which files should now be copied to the corresponding location. For some packages there are "just unzip and use it" archives located at http://mirror.ctan.org/install/macros/latex/contrib/ .

But when doing a full install of the TUG version of TeXlive you should have most of the package (if not all the packages) you need. If there is a specific package missing please name it so we can help.
I tried to find and install a latex package manager. From my search I found something called tlmgr but seems that there is no Centos version of it available.
This sounds as if you had installed TeXlive from the CentOS repositories.
how should I install a package manually?
As already mentioned above this depends on the package, so we need to know what packages you are missing.

astronasrin
Posts: 4
Joined: 2016/11/18 18:42:21

Re: Installing latex packages

Post by astronasrin » 2016/11/29 23:38:34

Hello again;

I installed the TUG version of texlive, but still have troubles with packages. There are still a lot of packages missing (I can't say exactly cause Latex just stops compiling once it sees the first unavailable package). For example:

todonotes.sty
lipsum.sty
here.sty
tabu.sty

And a lot more. Could you please help me go through this? Sorry I am very new to Centos. :roll:

Thanks

owl102
Posts: 334
Joined: 2014/06/10 19:13:41

Re: Installing latex packages

Post by owl102 » 2016/11/30 07:42:59

astronasrin wrote:todonotes.sty
lipsum.sty
here.sty
tabu.sty
These packages are part of TeXlive 2016. Proof:

Code: Select all

$ find /usr/local -name todonotes.sty -print
/usr/local/texlive/2016/texmf-dist/tex/latex/todonotes/todonotes.sty
$ find /usr/local -name lipsum.sty -print
/usr/local/texlive/2016/texmf-dist/tex/latex/lipsum/lipsum.sty
$ find /usr/local -name here.sty -print
/usr/local/texlive/2016/texmf-dist/tex/latex/here/here.sty
$ find /usr/local -name tabu.sty -print
/usr/local/texlive/2016/texmf-dist/tex/latex/tabu/tabu.sty
I guess you are still using the TeX provided by CentOS. What is the output of "which pdflatex"? It should be either

Code: Select all

$ which pdflatex
/usr/local/bin/pdflatex
or

Code: Select all

$ which pdflatex
/usr/local/texlive/2016/bin/x86_64-linux/pdflatex
If it's not make sure the location of the binaries of TeXlive 2016 are in PATH, and is ahead of /usr/bin. The easiest way to make so is starting the TeXlive manager (as root):

Code: Select all

/usr/local/texlive/2016/bin/x86_64-linux/tlmgr --gui
Within the TeXlive GUI select the menu entry "Actions", "Handle symlinks in system dirs...". Click "Update symbolic links" and "OK". Afterwards leave the GUI and try again.

astronasrin
Posts: 4
Joined: 2016/11/18 18:42:21

Re: Installing latex packages

Post by astronasrin » 2016/11/30 14:39:56

The output of "which pdflatex" is:

Code: Select all

/usr/bin/pdflatex
Also it can find the .sty file:

Code: Select all

find /usr/local -name todonotes.sty -print
/usr/local/texlive/2016/texmf-dist/tex/latex/todonotes/todonotes.sty
So why I receive the warning message that the package is not found? Is it possible that the problem is with Texmaker?

owl102
Posts: 334
Joined: 2014/06/10 19:13:41

Re: Installing latex packages

Post by owl102 » 2016/11/30 15:07:55

astronasrin wrote:The output of "which pdflatex" is:

Code: Select all

/usr/bin/pdflatex
That's the problem, it should be either /usr/local/bin/pdflatex or /usr/local/texlive/2016/bin/x86_64-linux/pdflatex. (/usr/bin/pdflatex is the version offered by CentOS.)

So updating symlinks in tlmgr (as I have described in my previous post) should help.

Post Reply