[Tex/LaTex] TeX Live — problem with install [Ubuntu, bash]; new packages

installingpackagestexliveUbuntu

I don't know how to install new packages. I've tried to install texLive [I have installed sudo apt-get install texlive-full — which went correct, but I can not install Tex Live], but after install TeX Live dosent'respond. I write tlmgr, and I get response 'no comand 'tlmgr' ' I have read documentation, but now I am confused even more.

So:

  1. how to install TeX Live on bash [correctly]

  2. Say I want to install packages: xcoffins.sty

    • what kind of file download from CTAN?
    • where put them?
    • how to make them work with TeXstudio?
  3. How to keep TeX Live updating new packages

How to do this Step-by-Step.

I feel like I have tried absolutly every way, but not the correct one.

Best Answer

actually this is a further comment on corentin's answer, but it exceeds 600 characters.


Since http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/ is an Apache directory listing you can try downloading packages with wget. For example if you want to download l3experimental where xcoffins is a subfolder you can invoke wget like

wget --cut-dir=4 -np -R "index.html*" -nH -P ~/texmf -r http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental/

or

wget --cut-dir=6 -np -R "index.html*" -P ~/texmf/tex/latex -r http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental/

this.

  • -P ~/dir/in/home/directory/ specifies the local directory where wget should put your files.
  • -nH tells wget that you don't want to create directories named after the host i.e. ~/texmf/www.tug.org/*/*/ looks not so nice and latex won't find anything under ~/texmf/www.tug.org. But you can omit -nH and change the local directory to -P ~/textmf/tex/latex. Then you have a seperate directory tree that latex also searches.
  • whereby --cut-dir=x means that you don't want to create the first x folders of the uri in your local directory (you want to create ~/texmf/tex/latex/l3experimental/ or ~/texmf/tex/latex/www.tug.org/l3experimental/ instead of ~/textmf/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental).
  • -R instructs wget to exclude all files beginning with index.html.
  • -r is for recursive fetch
  • the argument of -P is the directory where you want to save all those things
  • -np excludes all parent directories of l3experimental (of course you can find a more detailed description in the manual pages of wget)

but generally be careful if you download things with wget recursively it could mess up a whole directory tree. I would recommend you to first download the files in a temporary directory (for example with -P ~/texmftemporary) where you can examine the downloaded directory tree.

Since latex also searches recursively for packages in ~/texmf/tex/latex you don't have to bother if xcoffins is a subfolder of any other folder/folders.

Of course you can redefine things further if you write a little bash, perl or whatever script that is based on the above command.

Maybe this helps you!?